Пример #1
0
        public EditActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add ("Menu.Edit.Deselect.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.Deselect.png")));
            fact.Add ("Menu.Edit.EraseSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.EraseSelection.png")));
            fact.Add ("Menu.Edit.FillSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.FillSelection.png")));
            fact.Add ("Menu.Edit.InvertSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.InvertSelection.png")));
            fact.Add ("Menu.Edit.SelectAll.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.SelectAll.png")));
            fact.AddDefault ();

            Undo = new Gtk.Action ("Undo", Mono.Unix.Catalog.GetString ("Undo"), null, "gtk-undo");
            Redo = new Gtk.Action ("Redo", Mono.Unix.Catalog.GetString ("Redo"), null, "gtk-redo");
            Cut = new Gtk.Action ("Cut", Mono.Unix.Catalog.GetString ("Cut"), null, "gtk-cut");
            Copy = new Gtk.Action ("Copy", Mono.Unix.Catalog.GetString ("Copy"), null, "gtk-copy");
            Paste = new Gtk.Action ("Paste", Mono.Unix.Catalog.GetString ("Paste"), null, "gtk-paste");
            PasteIntoNewLayer = new Gtk.Action ("PasteIntoNewLayer", Mono.Unix.Catalog.GetString ("Paste Into New Layer"), null, "gtk-paste");
            PasteIntoNewImage = new Gtk.Action ("PasteIntoNewImage", Mono.Unix.Catalog.GetString ("Paste Into New Image"), null, "gtk-paste");
            EraseSelection = new Gtk.Action ("EraseSelection", Mono.Unix.Catalog.GetString ("Erase Selection"), null, "Menu.Edit.EraseSelection.png");
            FillSelection = new Gtk.Action ("FillSelection", Mono.Unix.Catalog.GetString ("Fill Selection"), null, "Menu.Edit.FillSelection.png");
            InvertSelection = new Gtk.Action ("InvertSelection", Mono.Unix.Catalog.GetString ("Invert Selection"), null, "Menu.Edit.InvertSelection.png");
            SelectAll = new Gtk.Action ("SelectAll", Mono.Unix.Catalog.GetString ("Select All"), null, "Menu.Edit.SelectAll.png");
            Deselect = new Gtk.Action ("Deselect", Mono.Unix.Catalog.GetString ("Deselect"), null, "Menu.Edit.Deselect.png");

            Undo.Sensitive = false;
            Redo.Sensitive = false;
            PasteIntoNewImage.Sensitive = false;
            InvertSelection.Sensitive = false;
            Deselect.Sensitive = false;
        }
Пример #2
0
        public EditActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add ("Menu.Edit.Deselect.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.Deselect.png")));
            fact.Add ("Menu.Edit.EraseSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.EraseSelection.png")));
            fact.Add ("Menu.Edit.FillSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.FillSelection.png")));
            fact.Add ("Menu.Edit.InvertSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.InvertSelection.png")));
            fact.Add ("Menu.Edit.SelectAll.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.SelectAll.png")));
            fact.AddDefault ();

            Undo = new Gtk.Action ("Undo", Catalog.GetString ("Undo"), null, Stock.Undo);
            Redo = new Gtk.Action ("Redo", Catalog.GetString ("Redo"), null, Stock.Redo);
            Cut = new Gtk.Action ("Cut", Catalog.GetString ("Cut"), null, Stock.Cut);
            Copy = new Gtk.Action ("Copy", Catalog.GetString ("Copy"), null, Stock.Copy);
            Paste = new Gtk.Action ("Paste", Catalog.GetString ("Paste"), null, Stock.Paste);

                PasteSubmenu = new Gtk.Action("Paste into", Catalog.GetString("Paste into..."), null, Stock.Paste);
                PasteIntoNewImage = new Gtk.Action("PasteIntoNewImage", Catalog.GetString("New image"), null, Stock.New);
                PasteIntoNewLayer = new Gtk.Action("PasteIntoNewLayer", Catalog.GetString("New layer"), null, "Menu.Layers.AddNewLayer.png");

            EraseSelection = new Gtk.Action ("EraseSelection", Catalog.GetString ("Erase Selection"), null, "Menu.Edit.EraseSelection.png");
            FillSelection = new Gtk.Action ("FillSelection", Catalog.GetString ("Fill Selection"), null, "Menu.Edit.FillSelection.png");
            InvertSelection = new Gtk.Action ("InvertSelection", Catalog.GetString ("Invert Selection"), null, "Menu.Edit.InvertSelection.png");
            SelectAll = new Gtk.Action ("SelectAll", Catalog.GetString ("Select All"), null, Stock.SelectAll);
            Deselect = new Gtk.Action ("Deselect", Catalog.GetString ("Deselect"), null, "Menu.Edit.Deselect.png");

            Undo.IsImportant = true;
            Undo.Sensitive = false;
            Redo.Sensitive = false;
            InvertSelection.Sensitive = false;
            Deselect.Sensitive = false;
            EraseSelection.Sensitive = false;
            FillSelection.Sensitive = false;
        }
Пример #3
0
 static TextTool()
 {
     Gtk.IconFactory fact = new Gtk.IconFactory();
     fact.Add("ShapeTool.Outline.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("ShapeTool.Outline.png")));
     fact.Add("ShapeTool.Fill.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("ShapeTool.Fill.png")));
     fact.Add("ShapeTool.OutlineFill.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("ShapeTool.OutlineFill.png")));
     fact.Add("TextTool.FillBackground.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("TextTool.FillBackground.png")));
     fact.AddDefault();
 }
Пример #4
0
 static TextTool()
 {
     Gtk.IconFactory fact = new Gtk.IconFactory ();
     fact.Add ("ShapeTool.Outline.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("ShapeTool.Outline.png")));
     fact.Add ("ShapeTool.Fill.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("ShapeTool.Fill.png")));
     fact.Add ("ShapeTool.OutlineFill.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("ShapeTool.OutlineFill.png")));
     fact.Add ("TextTool.FillBackground.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("TextTool.FillBackground.png")));
     fact.AddDefault ();
 }
Пример #5
0
 static BaseTool()
 {
     Gtk.IconFactory fact = new Gtk.IconFactory();
     fact.Add("Toolbar.AntiAliasingEnabledIcon.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Toolbar.AntiAliasingEnabledIcon.png")));
     fact.Add("Toolbar.AntiAliasingDisabledIcon.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Toolbar.AntiAliasingDisabledIcon.png")));
     fact.Add("Toolbar.BlendingEnabledIcon.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Toolbar.BlendingEnabledIcon.png")));
     fact.Add("Toolbar.BlendingOverwriteIcon.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Toolbar.BlendingOverwriteIcon.png")));
     fact.Add("Tools.FreeformShape.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Tools.FreeformShape.png")));
     fact.AddDefault();
 }
Пример #6
0
 static BaseTool()
 {
     Gtk.IconFactory fact = new Gtk.IconFactory ();
     fact.Add ("Toolbar.AntiAliasingEnabledIcon.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Toolbar.AntiAliasingEnabledIcon.png")));
     fact.Add ("Toolbar.AntiAliasingDisabledIcon.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Toolbar.AntiAliasingDisabledIcon.png")));
     fact.Add ("Toolbar.BlendingEnabledIcon.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Toolbar.BlendingEnabledIcon.png")));
     fact.Add ("Toolbar.BlendingOverwriteIcon.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Toolbar.BlendingOverwriteIcon.png")));
     fact.Add ("Tools.FreeformShape.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Tools.FreeformShape.png")));
     fact.AddDefault ();
 }
Пример #7
0
        public ImageActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory();
            fact.Add("Menu.Image.CanvasSize.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Image.CanvasSize.png")));
            fact.Add("Menu.Image.Crop.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Image.Crop.png")));
            fact.Add("Menu.Image.Flatten.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Image.Flatten.png")));
            fact.Add("Menu.Image.FlipHorizontal.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Image.FlipHorizontal.png")));
            fact.Add("Menu.Image.FlipVertical.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Image.FlipVertical.png")));
            fact.Add("Menu.Image.Resize.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Image.Resize.png")));
            fact.Add("Menu.Image.Rotate180CW.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Image.Rotate180CW.png")));
            fact.Add("Menu.Image.Rotate90CCW.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Image.Rotate90CCW.png")));
            fact.Add("Menu.Image.Rotate90CW.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Image.Rotate90CW.png")));
            fact.AddDefault();

            CropToSelection = new Gtk.Action("CropToSelection", Catalog.GetString("Crop to Selection"), null, "Menu.Image.Crop.png");
            AutoCrop        = new Gtk.Action("AutoCrop", Catalog.GetString("Auto Crop"), null, "Menu.Image.Crop.png");
            Resize          = new Gtk.Action("Resize", Catalog.GetString("Resize Image..."), null, "Menu.Image.Resize.png");
            CanvasSize      = new Gtk.Action("CanvasSize", Catalog.GetString("Resize Canvas..."), null, "Menu.Image.CanvasSize.png");
            FlipHorizontal  = new Gtk.Action("FlipHorizontal", Catalog.GetString("Flip Horizontal"), null, "Menu.Image.FlipHorizontal.png");
            FlipVertical    = new Gtk.Action("FlipVertical", Catalog.GetString("Flip Vertical"), null, "Menu.Image.FlipVertical.png");
            RotateCW        = new Gtk.Action("RotateCW", Catalog.GetString("Rotate 90° Clockwise"), null, "Menu.Image.Rotate90CW.png");
            RotateCCW       = new Gtk.Action("RotateCCW", Catalog.GetString("Rotate 90° Counter-Clockwise"), null, "Menu.Image.Rotate90CCW.png");
            Rotate180       = new Gtk.Action("Rotate180", Catalog.GetString("Rotate 180°"), null, "Menu.Image.Rotate180CW.png");
            Flatten         = new Gtk.Action("Flatten", Catalog.GetString("Flatten"), null, "Menu.Image.Flatten.png");

            CropToSelection.Sensitive = false;
        }
Пример #8
0
        public ImageActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add ("Menu.Image.CanvasSize.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.CanvasSize.png")));
            fact.Add ("Menu.Image.Crop.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.Crop.png")));
            fact.Add ("Menu.Image.Flatten.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.Flatten.png")));
            fact.Add ("Menu.Image.FlipHorizontal.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.FlipHorizontal.png")));
            fact.Add ("Menu.Image.FlipVertical.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.FlipVertical.png")));
            fact.Add ("Menu.Image.Resize.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.Resize.png")));
            fact.Add ("Menu.Image.Rotate180CW.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.Rotate180CW.png")));
            fact.Add ("Menu.Image.Rotate90CCW.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.Rotate90CCW.png")));
            fact.Add ("Menu.Image.Rotate90CW.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.Rotate90CW.png")));
            fact.AddDefault ();

            CropToSelection = new Gtk.Action ("CropToSelection", Catalog.GetString ("Crop to Selection"), null, "Menu.Image.Crop.png");
            AutoCrop = new Gtk.Action ("AutoCrop", Catalog.GetString ("Auto Crop"), null, "Menu.Image.Crop.png");
            Resize = new Gtk.Action ("Resize", Catalog.GetString ("Resize Image..."), null, "Menu.Image.Resize.png");
            CanvasSize = new Gtk.Action ("CanvasSize", Catalog.GetString ("Resize Canvas..."), null, "Menu.Image.CanvasSize.png");
            FlipHorizontal = new Gtk.Action ("FlipHorizontal", Catalog.GetString ("Flip Horizontal"), null, "Menu.Image.FlipHorizontal.png");
            FlipVertical = new Gtk.Action ("FlipVertical", Catalog.GetString ("Flip Vertical"), null, "Menu.Image.FlipVertical.png");
            RotateCW = new Gtk.Action ("RotateCW", Catalog.GetString ("Rotate 90° Clockwise"), null, "Menu.Image.Rotate90CW.png");
            RotateCCW = new Gtk.Action ("RotateCCW", Catalog.GetString ("Rotate 90° Counter-Clockwise"), null, "Menu.Image.Rotate90CCW.png");
            Rotate180 = new Gtk.Action ("Rotate180", Catalog.GetString ("Rotate 180°"), null, "Menu.Image.Rotate180CW.png");
            Flatten = new Gtk.Action ("Flatten", Catalog.GetString ("Flatten"), null, "Menu.Image.Flatten.png");

            CropToSelection.Sensitive = false;
        }
Пример #9
0
        public HelpActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add ("Menu.Help.Bug.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Help.Bug.png")));
            fact.Add ("Menu.Help.Website.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Help.Website.png")));
            fact.Add ("Menu.Help.Translate.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Help.Translate.png")));
            fact.AddDefault ();

            Website = new Gtk.Action ("Website", Catalog.GetString ("Pinta Website"), null, "Menu.Help.Website.png");
            Bugs = new Gtk.Action ("Bugs", Catalog.GetString ("File a Bug"), null, "Menu.Help.Bug.png");
            Translate = new Gtk.Action ("Translate", Catalog.GetString ("Translate This Application"), null, "Menu.Help.Translate.png");
            About = new Gtk.Action ("About", Catalog.GetString ("About"), null, Stock.About);
        }
Пример #10
0
        public HelpActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory();
            fact.Add("Menu.Help.Bug.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Help.Bug.png")));
            fact.Add("Menu.Help.Website.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Help.Website.png")));
            fact.Add("Menu.Help.Translate.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Help.Translate.png")));
            fact.AddDefault();

            Website   = new Gtk.Action("Website", Catalog.GetString("Pinta Website"), null, "Menu.Help.Website.png");
            Bugs      = new Gtk.Action("Bugs", Catalog.GetString("File a Bug"), null, "Menu.Help.Bug.png");
            Translate = new Gtk.Action("Translate", Catalog.GetString("Translate This Application"), null, "Menu.Help.Translate.png");
            About     = new Gtk.Action("About", Catalog.GetString("About"), null, Stock.About);
        }
Пример #11
0
        /// <summary>
        /// Register a new adjustment with Pinta, causing it to be added to the Adjustments menu.
        /// </summary>
        /// <param name="adjustment">The adjustment to register</param>
        /// <returns>The action created for this adjustment</returns>
        public Gtk.Action RegisterAdjustment(BaseEffect adjustment)
        {
            // Add icon to IconFactory
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add (adjustment.Icon, new Gtk.IconSet (PintaCore.Resources.GetIcon (adjustment.Icon)));
            fact.AddDefault ();

            // Create a gtk action for each adjustment
            Gtk.Action act = new Gtk.Action (adjustment.GetType ().Name, adjustment.Name + (adjustment.IsConfigurable ? Catalog.GetString ("...") : ""), string.Empty, adjustment.Icon);
            act.Activated += delegate (object sender, EventArgs e) { PintaCore.LivePreview.Start (adjustment); };

            PintaCore.Actions.Adjustments.Actions.Add (act);

            // Create a menu item for each adjustment
            MenuItem menu_item;

            // If no key is specified, don't use an accelerated menu item
            if (adjustment.AdjustmentMenuKey == (Gdk.Key)0)
                menu_item = (MenuItem)act.CreateMenuItem ();
            else
                menu_item = act.CreateAcceleratedMenuItem (adjustment.AdjustmentMenuKey, adjustment.AdjustmentMenuKeyModifiers);

            ((Menu)((ImageMenuItem)PintaCore.Chrome.MainMenu.Children[5]).Submenu).AppendMenuItemSorted (menu_item);

            adjustments.Add (adjustment, act);
            adjustment_menuitems.Add (adjustment, menu_item);

            return act;
        }
Пример #12
0
 /// Add New Pixbuf to Stock
 public static void AddToStock(string name, Gdk.Pixbuf pixbuf)
 {
     Gtk.IconFactory factory = new Gtk.IconFactory();
     factory.AddDefault();
     Gtk.IconSet iconset = new Gtk.IconSet(pixbuf);
     factory.Add(name, iconset);
 }
Пример #13
0
        /// <summary>
        /// Register a new adjustment with Pinta, causing it to be added to the Adjustments menu.
        /// </summary>
        /// <param name="adjustment">The adjustment to register</param>
        /// <returns>The action created for this adjustment</returns>
        public Gtk.Action RegisterAdjustment(BaseEffect adjustment)
        {
            // Add icon to IconFactory
            Gtk.IconFactory fact = new Gtk.IconFactory();
            fact.Add(adjustment.Icon, new Gtk.IconSet(PintaCore.Resources.GetIcon(adjustment.Icon)));
            fact.AddDefault();

            // Create a gtk action for each adjustment
            Gtk.Action act = new Gtk.Action(adjustment.GetType().Name, adjustment.Name + (adjustment.IsConfigurable ? Catalog.GetString("...") : ""), string.Empty, adjustment.Icon);
            act.Activated += delegate(object sender, EventArgs e) { PintaCore.LivePreview.Start(adjustment); };

            PintaCore.Actions.Adjustments.Actions.Add(act);

            // Create a menu item for each adjustment
            MenuItem menu_item;

            // If no key is specified, don't use an accelerated menu item
            if (adjustment.AdjustmentMenuKey == (Gdk.Key) 0)
            {
                menu_item = (MenuItem)act.CreateMenuItem();
            }
            else
            {
                menu_item = act.CreateAcceleratedMenuItem(adjustment.AdjustmentMenuKey, adjustment.AdjustmentMenuKeyModifiers);
            }

            ((Menu)((ImageMenuItem)PintaCore.Chrome.MainMenu.Children[5]).Submenu).AppendMenuItemSorted(menu_item);

            adjustments.Add(adjustment, act);
            adjustment_menuitems.Add(adjustment, menu_item);

            return(act);
        }
Пример #14
0
        private void CreateDockAndPads(HBox container)
        {
            Gtk.IconFactory fact = new Gtk.IconFactory();
            fact.Add("Tools.Pencil.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Tools.Pencil.png")));
            fact.Add("Pinta.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Pinta.png")));
            fact.AddDefault();

            // Dock widget
            dock = new DockFrame();
            dock.CompactGuiLevel = 5;

            // Toolbox pad
            //var toolboxpad = new ToolBoxPad ();
            //toolboxpad.Initialize (dock, show_pad);

            // Palette pad
            var palettepad = new ColorPalettePad();

            palettepad.Initialize(dock, show_pad);

            // Canvas pad
            canvas_pad = new CanvasPad();
            canvas_pad.Initialize(dock, show_pad);

            sw = canvas_pad.ScrolledWindow;

            // Layer pad
            var layers_pad = new LayersPad();

            layers_pad.Initialize(dock, show_pad);

            // Open Images pad
            var open_images_pad = new OpenImagesPad();

            open_images_pad.Initialize(dock, show_pad);

            // History pad
            var history_pad = new HistoryPad();

            history_pad.Initialize(dock, show_pad);

            container.PackStart(dock, true, true, 0);

            dock.CreateLayout("Default", false);
            dock.CurrentLayout = "Default";
        }
Пример #15
0
        public ViewActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory();
            fact.Add("Menu.View.ActualSize.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.ActualSize.png")));
            fact.Add("Menu.View.Grid.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.Grid.png")));
            fact.Add("Menu.View.Rulers.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.Rulers.png")));
            fact.Add("Menu.View.ZoomIn.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.ZoomIn.png")));
            fact.Add("Menu.View.ZoomOut.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.ZoomOut.png")));
            fact.Add("Menu.View.ZoomToSelection.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.ZoomToSelection.png")));
            fact.Add("Menu.View.ZoomToWindow.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.ZoomToWindow.png")));
            fact.AddDefault();

            ZoomIn          = new Gtk.Action("ZoomIn", Catalog.GetString("Zoom In"), null, Stock.ZoomIn);
            ZoomOut         = new Gtk.Action("ZoomOut", Catalog.GetString("Zoom Out"), null, Stock.ZoomOut);
            ZoomToWindow    = new Gtk.Action("ZoomToWindow", Catalog.GetString("Best Fit"), null, Stock.ZoomFit);
            ZoomToSelection = new Gtk.Action("ZoomToSelection", Catalog.GetString("Zoom to Selection"), null, "Menu.View.ZoomToSelection.png");
            ActualSize      = new Gtk.Action("ActualSize", Catalog.GetString("Normal Size"), null, Stock.Zoom100);
            ToolBar         = new Gtk.ToggleAction("Toolbar", Catalog.GetString("Toolbar"), null, null);
            PixelGrid       = new Gtk.ToggleAction("PixelGrid", Catalog.GetString("Pixel Grid"), null, "Menu.View.Grid.png");
            Rulers          = new Gtk.ToggleAction("Rulers", Catalog.GetString("Rulers"), null, "Menu.View.Rulers.png");
            Pixels          = new Gtk.RadioAction("Pixels", Catalog.GetString("Pixels"), null, null, 0);
            Inches          = new Gtk.RadioAction("Inches", Catalog.GetString("Inches"), null, null, 1);
            Centimeters     = new Gtk.RadioAction("Centimeters", Catalog.GetString("Centimeters"), null, null, 2);
            Fullscreen      = new Gtk.Action("Fullscreen", Catalog.GetString("Fullscreen"), null, Stock.Fullscreen);

            ZoomCollection = new string[] { "3600%", "2400%", "1600%", "1200%", "800%", "700%", "600%", "500%", "400%", "300%", "200%", "175%", "150%", "125%", "100%", "66%", "50%", "33%", "25%", "16%", "12%", "8%", "5%", Catalog.GetString("Window") };
            ZoomComboBox   = new ToolBarComboBox(75, DefaultZoomIndex(), true, ZoomCollection);

            // Make sure these are the same group so only one will be selected at a time
            Inches.Group      = Pixels.Group;
            Centimeters.Group = Pixels.Group;
        }
Пример #16
0
        public ViewActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory();
            fact.Add("Menu.View.ActualSize.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.ActualSize.png")));
            fact.Add("Menu.View.Grid.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.Grid.png")));
            fact.Add("Menu.View.Rulers.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.Rulers.png")));
            fact.Add("Menu.View.ZoomIn.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.ZoomIn.png")));
            fact.Add("Menu.View.ZoomOut.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.ZoomOut.png")));
            fact.Add("Menu.View.ZoomToSelection.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.ZoomToSelection.png")));
            fact.Add("Menu.View.ZoomToWindow.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.ZoomToWindow.png")));
            fact.AddDefault();

            ZoomIn          = new Gtk.Action("ZoomIn", Catalog.GetString("Zoom In"), null, Stock.ZoomIn);
            ZoomOut         = new Gtk.Action("ZoomOut", Catalog.GetString("Zoom Out"), null, Stock.ZoomOut);
            ZoomToWindow    = new Gtk.Action("ZoomToWindow", Catalog.GetString("Best Fit"), null, Stock.ZoomFit);
            ZoomToSelection = new Gtk.Action("ZoomToSelection", Catalog.GetString("Zoom to Selection"), null, "Menu.View.ZoomToSelection.png");
            ActualSize      = new Gtk.Action("ActualSize", Catalog.GetString("Normal Size"), null, Stock.Zoom100);
            ToolBar         = new Gtk.ToggleAction("Toolbar", Catalog.GetString("Toolbar"), null, null);
            PixelGrid       = new Gtk.ToggleAction("PixelGrid", Catalog.GetString("Pixel Grid"), null, "Menu.View.Grid.png");
            Rulers          = new Gtk.ToggleAction("Rulers", Catalog.GetString("Rulers"), null, "Menu.View.Rulers.png");
            Pixels          = new Gtk.RadioAction("Pixels", Catalog.GetString("Pixels"), null, null, 0);
            Inches          = new Gtk.RadioAction("Inches", Catalog.GetString("Inches"), null, null, 1);
            Centimeters     = new Gtk.RadioAction("Centimeters", Catalog.GetString("Centimeters"), null, null, 2);
            Fullscreen      = new Gtk.Action("Fullscreen", Catalog.GetString("Fullscreen"), null, Stock.Fullscreen);

            ZoomCollection = new string[] {
                ToPercent(36),
                ToPercent(24),
                ToPercent(16),
                ToPercent(12),
                ToPercent(8),
                ToPercent(7),
                ToPercent(6),
                ToPercent(5),
                ToPercent(4),
                ToPercent(3),
                ToPercent(2),
                ToPercent(1.75),
                ToPercent(1.5),
                ToPercent(1.25),
                ToPercent(1),
                ToPercent(0.66),
                ToPercent(0.5),
                ToPercent(0.33),
                ToPercent(0.25),
                ToPercent(0.16),
                ToPercent(0.12),
                ToPercent(0.08),
                ToPercent(0.05),
                Catalog.GetString("Window")
            };
            ZoomComboBox = new ToolBarComboBox(90, DefaultZoomIndex(), true, ZoomCollection);

            // Make sure these are the same group so only one will be selected at a time
            Inches.Group      = Pixels.Group;
            Centimeters.Group = Pixels.Group;

            // The toolbar is shown by default.
            ToolBar.Active = true;
        }
Пример #17
0
        public ViewActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add ("Menu.View.ActualSize.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ActualSize.png")));
            fact.Add ("Menu.View.Grid.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.Grid.png")));
            fact.Add ("Menu.View.Rulers.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.Rulers.png")));
            fact.Add ("Menu.View.ZoomIn.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomIn.png")));
            fact.Add ("Menu.View.ZoomOut.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomOut.png")));
            fact.Add ("Menu.View.ZoomToSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomToSelection.png")));
            fact.Add ("Menu.View.ZoomToWindow.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomToWindow.png")));
            fact.AddDefault ();

            ZoomIn = new Gtk.Action ("ZoomIn", Catalog.GetString ("Zoom In"), null, Stock.ZoomIn);
            ZoomOut = new Gtk.Action ("ZoomOut", Catalog.GetString ("Zoom Out"), null, Stock.ZoomOut);
            ZoomToWindow = new Gtk.Action ("ZoomToWindow", Catalog.GetString ("Best Fit"), null, Stock.ZoomFit);
            ZoomToSelection = new Gtk.Action ("ZoomToSelection", Catalog.GetString ("Zoom to Selection"), null, "Menu.View.ZoomToSelection.png");
            ActualSize = new Gtk.Action ("ActualSize", Catalog.GetString ("Normal Size"), null, Stock.Zoom100);
            ToolBar = new Gtk.ToggleAction ("Toolbar", Catalog.GetString ("Toolbar"), null, null);
            PixelGrid = new Gtk.ToggleAction ("PixelGrid", Catalog.GetString ("Pixel Grid"), null, "Menu.View.Grid.png");
            Rulers = new Gtk.ToggleAction ("Rulers", Catalog.GetString ("Rulers"), null, "Menu.View.Rulers.png");
            Pixels = new Gtk.RadioAction ("Pixels", Catalog.GetString ("Pixels"), null, null, 0);
            Inches = new Gtk.RadioAction ("Inches", Catalog.GetString ("Inches"), null, null, 1);
            Centimeters = new Gtk.RadioAction ("Centimeters", Catalog.GetString ("Centimeters"), null, null, 2);
            Fullscreen = new Gtk.Action ("Fullscreen", Catalog.GetString ("Fullscreen"), null, Stock.Fullscreen);

            ZoomCollection = new string[] { "3600%", "2400%", "1600%", "1200%", "800%", "700%", "600%", "500%", "400%", "300%", "200%", "175%", "150%", "125%", "100%", "66%", "50%", "33%", "25%", "16%", "12%", "8%", "5%", "Window" };
            ZoomComboBox = new ToolBarComboBox (75, DefaultZoomIndex(), true, ZoomCollection);

            // Make sure these are the same group so only one will be selected at a time
            Inches.Group = Pixels.Group;
            Centimeters.Group = Pixels.Group;
        }
Пример #18
0
        public ViewActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add ("Menu.View.ActualSize.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ActualSize.png")));
            fact.Add ("Menu.View.Grid.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.Grid.png")));
            fact.Add ("Menu.View.Rulers.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.Rulers.png")));
            fact.Add ("Menu.View.ZoomIn.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomIn.png")));
            fact.Add ("Menu.View.ZoomOut.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomOut.png")));
            fact.Add ("Menu.View.ZoomToSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomToSelection.png")));
            fact.Add ("Menu.View.ZoomToWindow.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomToWindow.png")));
            fact.AddDefault ();

            ZoomIn = new Gtk.Action ("ZoomIn", Catalog.GetString ("Zoom In"), null, Stock.ZoomIn);
            ZoomOut = new Gtk.Action ("ZoomOut", Catalog.GetString ("Zoom Out"), null, Stock.ZoomOut);
            ZoomToWindow = new Gtk.Action ("ZoomToWindow", Catalog.GetString ("Zoom to Window"), null, Stock.ZoomFit);
            ZoomToSelection = new Gtk.Action ("ZoomToSelection", Catalog.GetString ("Zoom to Selection"), null, "Menu.View.ZoomToSelection.png");
            ActualSize = new Gtk.Action ("ActualSize", Catalog.GetString ("Actual Size"), null, Stock.Zoom100);
            PixelGrid = new Gtk.ToggleAction ("PixelGrid", Catalog.GetString ("Pixel Grid"), null, "Menu.View.Grid.png");
            Rulers = new Gtk.ToggleAction ("Rulers", Catalog.GetString ("Rulers"), null, "Menu.View.Rulers.png");
            Pixels = new Gtk.Action ("Pixels", Catalog.GetString ("Pixels"), null, null);
            Inches = new Gtk.Action ("Inches", Catalog.GetString ("Inches"), null, null);
            Centimeters = new Gtk.Action ("Centimeters", Catalog.GetString ("Centimeters"), null, null);
            Fullscreen = new Gtk.Action ("Fullscreen", Catalog.GetString ("Fullscreen"), null, Stock.Fullscreen);

            ZoomComboBox = new ToolBarComboBox (75, 11, true, "3600%", "2400%", "1600%", "1200%", "800%", "700%", "600%", "500%", "400%", "300%", "200%", "100%", "66%", "50%", "33%", "25%", "16%", "12%", "8%", "5%", "Window");
            UnitComboBox = new ToolBarComboBox (100, 0, false, Catalog.GetString ("Pixels"), Catalog.GetString ("Inches"), Catalog.GetString ("Centimeters"));
        }
		static DemoApplicationWindow ()
		{
			// Register our custom toolbar icons, for themability

			Gdk.Pixbuf pixbuf = Gdk.Pixbuf.LoadFromResource ("gtk-logo-rgb.gif");
			Gdk.Pixbuf transparent = pixbuf.AddAlpha (true, 0xff, 0xff, 0xff);

			IconFactory factory = new IconFactory ();
			factory.Add ("demo-gtk-logo", new IconSet (transparent));
			factory.AddDefault ();

			StockManager.Add (new StockItem ("demo-gtk-logo", "_GTK#", 0, 0, null));
		}
Пример #20
0
        void AddStockIcon(IconFactory factory, string stockId, string filename)
        {
            var pixbuf = new Pixbuf(Assembly.GetCallingAssembly(), filename);

              var source = new IconSource() {
            Pixbuf = pixbuf,
            SizeWildcarded = true,
            Size = IconSize.SmallToolbar};

              var set = new IconSet();
              set.AddSource(source);

              factory.Add(stockId, set);
        }
Пример #21
0
        public EditActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add ("Menu.Edit.Deselect.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.Deselect.png")));
            fact.Add ("Menu.Edit.EraseSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.EraseSelection.png")));
            fact.Add ("Menu.Edit.FillSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.FillSelection.png")));
            fact.Add ("Menu.Edit.InvertSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.InvertSelection.png")));
            fact.Add ("Menu.Edit.SelectAll.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.SelectAll.png")));
            fact.AddDefault ();

            Undo = new Gtk.Action ("Undo", Catalog.GetString ("Undo"), null, Stock.Undo);
            Redo = new Gtk.Action ("Redo", Catalog.GetString ("Redo"), null, Stock.Redo);
            Cut = new Gtk.Action ("Cut", Catalog.GetString ("Cut"), null, Stock.Cut);
            Copy = new Gtk.Action ("Copy", Catalog.GetString ("Copy"), null, Stock.Copy);
            Paste = new Gtk.Action ("Paste", Catalog.GetString ("Paste"), null, Stock.Paste);
            PasteIntoNewLayer = new Gtk.Action ("PasteIntoNewLayer", Catalog.GetString ("Paste Into New Layer"), null, Stock.Paste);
            PasteIntoNewImage = new Gtk.Action ("PasteIntoNewImage", Catalog.GetString ("Paste Into New Image"), null, Stock.Paste);
            EraseSelection = new Gtk.Action ("EraseSelection", Catalog.GetString ("Erase Selection"), null, "Menu.Edit.EraseSelection.png");
            FillSelection = new Gtk.Action ("FillSelection", Catalog.GetString ("Fill Selection"), null, "Menu.Edit.FillSelection.png");
            InvertSelection = new Gtk.Action ("InvertSelection", Catalog.GetString ("Invert Selection"), null, "Menu.Edit.InvertSelection.png");
            SelectAll = new Gtk.Action ("SelectAll", Catalog.GetString ("Select All"), null, Stock.SelectAll);
            Deselect = new Gtk.Action ("Deselect", Catalog.GetString ("Deselect"), null, "Menu.Edit.Deselect.png");

            LoadPalette = new Gtk.Action ("LoadPalette", Catalog.GetString ("Open..."), null, Stock.Open);
            SavePalette = new Gtk.Action ("SavePalette", Catalog.GetString ("Save As..."), null, Stock.Save);
            ResetPalette = new Gtk.Action ("ResetPalette", Catalog.GetString ("Reset to Default"), null, Stock.RevertToSaved);
            ResizePalette = new Gtk.Action ("ResizePalette", Catalog.GetString ("Set Number of Colors"), null, "Menu.Image.Resize.png");

            Undo.IsImportant = true;
            Undo.Sensitive = false;
            Redo.Sensitive = false;
            PasteIntoNewImage.Sensitive = false;
            InvertSelection.Sensitive = false;
            Deselect.Sensitive = false;
            EraseSelection.Sensitive = false;
            FillSelection.Sensitive = false;
        }
        static void AddToIconFactory(string stockId, Gdk.Pixbuf pixbuf, Gdk.Pixbuf pixbuf2x, Gtk.IconSize iconSize)
        {
            Gtk.IconSet iconSet = iconFactory.Lookup(stockId);
            if (iconSet == null)
            {
                iconSet = new Gtk.IconSet();
                iconFactory.Add(stockId, iconSet);
            }

            Gtk.IconSource source   = new Gtk.IconSource();
            Gtk.IconSource source2x = null;

            if (Platform.IsWindows)
            {
                var pixel_scale = GtkWorkarounds.GetPixelScale();
                source.Pixbuf = pixbuf.ScaleSimple((int)(pixbuf.Width * pixel_scale), (int)(pixbuf.Height * pixel_scale), Gdk.InterpType.Bilinear);
            }
            else
            {
                source.Pixbuf = pixbuf;
            }

            source.Size           = iconSize;
            source.SizeWildcarded = iconSize == Gtk.IconSize.Invalid;

            if (pixbuf2x != null)
            {
                if (GtkWorkarounds.SetSourceScale(source, 1))
                {
                    GtkWorkarounds.SetSourceScaleWildcarded(source, false);
                    source2x                = new Gtk.IconSource();
                    source2x.Pixbuf         = pixbuf2x;
                    source2x.Size           = iconSize;
                    source2x.SizeWildcarded = iconSize == Gtk.IconSize.Invalid;
                    GtkWorkarounds.SetSourceScale(source2x, 2);
                    GtkWorkarounds.SetSourceScaleWildcarded(source2x, false);
                }
            }
            else
            {
                GtkWorkarounds.SetSourceScaleWildcarded(source, true);
            }

            iconSet.AddSource(source);
            if (source2x != null)
            {
                iconSet.AddSource(source2x);
            }
        }
Пример #23
0
        public EditActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory();
            fact.Add("Menu.Edit.Deselect.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.Deselect.png")));
            fact.Add("Menu.Edit.EraseSelection.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.EraseSelection.png")));
            fact.Add("Menu.Edit.FillSelection.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.FillSelection.png")));
            fact.Add("Menu.Edit.InvertSelection.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.InvertSelection.png")));
            fact.Add("Menu.Edit.SelectAll.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.SelectAll.png")));
            fact.AddDefault();

            Undo              = new Gtk.Action("Undo", Catalog.GetString("Undo"), null, Stock.Undo);
            Redo              = new Gtk.Action("Redo", Catalog.GetString("Redo"), null, Stock.Redo);
            Cut               = new Gtk.Action("Cut", Catalog.GetString("Cut"), null, Stock.Cut);
            Copy              = new Gtk.Action("Copy", Catalog.GetString("Copy"), null, Stock.Copy);
            Paste             = new Gtk.Action("Paste", Catalog.GetString("Paste"), null, Stock.Paste);
            PasteIntoNewLayer = new Gtk.Action("PasteIntoNewLayer", Catalog.GetString("Paste Into New Layer"), null, Stock.Paste);
            PasteIntoNewImage = new Gtk.Action("PasteIntoNewImage", Catalog.GetString("Paste Into New Image"), null, Stock.Paste);
            EraseSelection    = new Gtk.Action("EraseSelection", Catalog.GetString("Delete Selection"), null, "Menu.Edit.EraseSelection.png");
            FillSelection     = new Gtk.Action("FillSelection", Catalog.GetString("Fill Selection"), null, "Menu.Edit.FillSelection.png");
            InvertSelection   = new Gtk.Action("InvertSelection", Catalog.GetString("Invert Selection"), null, "Menu.Edit.InvertSelection.png");
            SelectAll         = new Gtk.Action("SelectAll", Catalog.GetString("Select All"), null, Stock.SelectAll);
            Deselect          = new Gtk.Action("Deselect", Catalog.GetString("Deselect All"), null, "Menu.Edit.Deselect.png");

            LoadPalette   = new Gtk.Action("LoadPalette", Catalog.GetString("Open..."), null, Stock.Open);
            SavePalette   = new Gtk.Action("SavePalette", Catalog.GetString("Save As..."), null, Stock.Save);
            ResetPalette  = new Gtk.Action("ResetPalette", Catalog.GetString("Reset to Default"), null, Stock.RevertToSaved);
            ResizePalette = new Gtk.Action("ResizePalette", Catalog.GetString("Set Number of Colors"), null, "Menu.Image.Resize.png");

            Undo.IsImportant          = true;
            Undo.Sensitive            = false;
            Redo.Sensitive            = false;
            InvertSelection.Sensitive = false;
            Deselect.Sensitive        = false;
            EraseSelection.Sensitive  = false;
            FillSelection.Sensitive   = false;
        }
Пример #24
0
        static void AddIcon(string stockid, string resource)
        {
            Gtk.IconSet iconset = stock.Lookup(stockid);

            if (iconset == null)
            {
                iconset = new Gtk.IconSet();
                Gdk.Pixbuf img    = Gdk.Pixbuf.LoadFromResource(resource);
                IconSource source = new IconSource();
                source.Size           = Gtk.IconSize.Menu;
                source.SizeWildcarded = false;
                source.Pixbuf         = img;
                iconset.AddSource(source);
                stock.Add(stockid, iconset);
            }
        }
Пример #25
0
        /// <summary>
        /// Register a new effect with Pinta, causing it to be added to the Effects menu.
        /// </summary>
        /// <param name="effect">The effect to register</param>
        /// <returns>The action created for this effect</returns>
        public Gtk.Action RegisterEffect(BaseEffect effect)
        {
            // Add icon to IconFactory
            Gtk.IconFactory fact = new Gtk.IconFactory();
            fact.Add(effect.Icon, new Gtk.IconSet(PintaCore.Resources.GetIcon(effect.Icon)));
            fact.AddDefault();

            // Create a gtk action and menu item for each effect
            Gtk.Action act = new Gtk.Action(effect.GetType().Name, effect.Name + (effect.IsConfigurable ? Catalog.GetString("...") : ""), string.Empty, effect.Icon);
            act.Activated += delegate(object sender, EventArgs e) { PintaCore.LivePreview.Start(effect); };

            PintaCore.Actions.Effects.AddEffect(effect.EffectMenuCategory, act);

            effects.Add(effect, act);

            return(act);
        }
Пример #26
0
        public EditActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory();
            fact.Add("Menu.Edit.Deselect.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.Deselect.png")));
            fact.Add("Menu.Edit.EraseSelection.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.EraseSelection.png")));
            fact.Add("Menu.Edit.FillSelection.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.FillSelection.png")));
            fact.Add("Menu.Edit.InvertSelection.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.InvertSelection.png")));
            fact.Add("Menu.Edit.SelectAll.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.SelectAll.png")));
            fact.Add("Menu.Edit.Addins.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.Addins.png")));
            fact.AddDefault();

            Undo              = new Gtk.Action("Undo", Catalog.GetString("Undo"), null, Stock.Undo);
            Redo              = new Gtk.Action("Redo", Catalog.GetString("Redo"), null, Stock.Redo);
            Cut               = new Gtk.Action("Cut", Catalog.GetString("Cut"), null, Stock.Cut);
            Copy              = new Gtk.Action("Copy", Catalog.GetString("Copy"), null, Stock.Copy);
            CopyMerged        = new Gtk.Action("CopyMerged", Catalog.GetString("Copy Merged"), null, Stock.Copy);
            Paste             = new Gtk.Action("Paste", Catalog.GetString("Paste"), null, Stock.Paste);
            PasteIntoNewLayer = new Gtk.Action("PasteIntoNewLayer", Catalog.GetString("Paste Into New Layer"), null, Stock.Paste);
            PasteIntoNewImage = new Gtk.Action("PasteIntoNewImage", Catalog.GetString("Paste Into New Image"), null, Stock.Paste);
            EraseSelection    = new Gtk.Action("EraseSelection", Catalog.GetString("Erase Selection"), null, "Menu.Edit.EraseSelection.png");
            FillSelection     = new Gtk.Action("FillSelection", Catalog.GetString("Fill Selection"), null, "Menu.Edit.FillSelection.png");
            InvertSelection   = new Gtk.Action("InvertSelection", Catalog.GetString("Invert Selection"), null, "Menu.Edit.InvertSelection.png");
            SelectAll         = new Gtk.Action("SelectAll", Catalog.GetString("Select All"), null, Stock.SelectAll);
            Deselect          = new Gtk.Action("Deselect", Catalog.GetString("Deselect All"), null, "Menu.Edit.Deselect.png");
            Record            = new Gtk.Action("Record", Catalog.GetString("Start Session"), null, Stock.MediaRecord);

            LoadPalette   = new Gtk.Action("LoadPalette", Catalog.GetString("Open..."), null, Stock.Open);
            SavePalette   = new Gtk.Action("SavePalette", Catalog.GetString("Save As..."), null, Stock.Save);
            ResetPalette  = new Gtk.Action("ResetPalette", Catalog.GetString("Reset to Default"), null, Stock.RevertToSaved);
            ResizePalette = new Gtk.Action("ResizePalette", Catalog.GetString("Set Number of Colors"), null, "Menu.Image.Resize.png");

            Undo.IsImportant          = true;
            Undo.Sensitive            = false;
            Redo.Sensitive            = false;
            InvertSelection.Sensitive = false;
            Deselect.Sensitive        = false;
            Record.Sensitive          = true;
            EraseSelection.Sensitive  = false;
            FillSelection.Sensitive   = false;

            //video init
            this._isRecording = false;
            //this._screenSize = Screen.PrimaryScreen.Bounds;
            this._frameCount = 0;
            this._width      = SystemInformation.VirtualScreen.Width;
            this._height     = SystemInformation.VirtualScreen.Height;
            this._stopWatch  = new Stopwatch();
            this._screenArea = Screen.PrimaryScreen.Bounds;
            this._writer     = new VideoFileWriter();
        }
Пример #27
0
        public static void Initialize()
        {
            Gtk.IconFactory factory = new Gtk.IconFactory();
            factory.AddDefault();

            // Stock Icons
            foreach (string name in stock_icons)
            {
                Gdk.Pixbuf  pixbuf  = new Gdk.Pixbuf(null, name + ".png");
                Gtk.IconSet iconset = new Gtk.IconSet(pixbuf);

                factory.Add(name, iconset);
            }

            // Stock Images
            foreach (string name in stock_images_names)
            {
                stock_images.Add(name, new Gdk.Pixbuf(null, name + ".png"));
            }
        }
Пример #28
0
    static void AddIcon(string stockid, Gtk.IconSize iconSize, string resource)
    {
        Gtk.IconSet iconset = stock.Lookup(stockid);

        if (iconset == null)
        {
            iconset = new Gtk.IconSet();
            Gdk.Pixbuf img = Gdk.Pixbuf.LoadFromResource(resource);
            //no scaling in the given size, ...
            IconSource source = new IconSource();
            source.Size           = iconSize;
            source.SizeWildcarded = false;
            source.Pixbuf         = img;
            iconset.AddSource(source);
            //... but allow to use the image for all other sizes, too.
            source = new IconSource();
            source.SizeWildcarded = true;
            source.Pixbuf         = img;
            iconset.AddSource(source);

            stock.Add(stockid, iconset);
        }
    }
Пример #29
0
	public static void Initialize ()
	{
		Gtk.StockItem [] stock_items = {	
			FromDef ("f-spot-adjust-colors", Catalog.GetString ("Adjust Colors"), 0, Gdk.ModifierType.ShiftMask, null),
			FromDef ("f-spot-autocolor", Catalog.GetString ("Auto Color"), 0, Gdk.ModifierType.ShiftMask, null),
			FromDef ("f-spot-browse", Catalog.GetString ("Browse"), 0, Gdk.ModifierType.ShiftMask, null),
			FromDef ("f-spot-camera", Catalog.GetString ("Camera"), 0, Gdk.ModifierType.ShiftMask, null),
			FromDef ("f-spot-crop", Catalog.GetString ("Crop"), 0, Gdk.ModifierType.ShiftMask, null),
			FromDef ("f-spot-desaturate", Catalog.GetString ("Desaturate"), 0, Gdk.ModifierType.ShiftMask, null),
			FromDef ("f-spot-edit-image", Catalog.GetString ("Edit Photo"), 0, Gdk.ModifierType.ShiftMask, null),
			FromDef ("f-spot-fullscreen", Catalog.GetString ("Fullscreen"), 0, Gdk.ModifierType.ShiftMask, null),
			FromDef ("f-spot-horizon", Catalog.GetString ("Straighten"), 0, Gdk.ModifierType.ShiftMask, null),
			FromDef ("f-spot-loading", Catalog.GetString ("Loading"), 0, Gdk.ModifierType.ShiftMask, null),
			FromDef ("f-spot-new-tag", Catalog.GetString ("Create New Tag"), 0, Gdk.ModifierType.ShiftMask, null),
			FromDef ("f-spot-question-mark", Catalog.GetString ("Question"), 0, Gdk.ModifierType.ShiftMask, null),
			FromDef ("f-spot-red-eye", Catalog.GetString ("Reduce Red-Eye"), 0, Gdk.ModifierType.ShiftMask, null),
			FromDef ("f-spot-rotate-270", Catalog.GetString ("Rotate _Left"), 0, Gdk.ModifierType.ShiftMask, null),
			FromDef ("f-spot-rotate-90", Catalog.GetString ("Rotate _Right"), 0, Gdk.ModifierType.ShiftMask, null),
			FromDef ("f-spot-sepia", Catalog.GetString ("Sepia Tone"), 0, Gdk.ModifierType.ShiftMask, null),
			FromDef ("f-spot-slideshow", Catalog.GetString ("Slideshow"), 0, Gdk.ModifierType.ShiftMask, null),
			FromDef ("f-spot-soft-focus", Catalog.GetString ("Soft Focus"), 0, Gdk.ModifierType.ShiftMask, null),
			FromDef ("f-spot-stock_near", Catalog.GetString ("Near"), 0, Gdk.ModifierType.ShiftMask, null),
			FromDef ("f-spot-stock_far", Catalog.GetString ("Far"), 0, Gdk.ModifierType.ShiftMask, null),
			FromDef ("f-spot-view-restore", Catalog.GetString ("Restore View"), 0, Gdk.ModifierType.ShiftMask, null),
		};

		IconFactory icon_factory = new IconFactory ();
		icon_factory.AddDefault ();

		foreach (Gtk.StockItem item in stock_items) {
			Pixbuf pixbuf = PixbufUtils.LoadFromAssembly (item.StockId + ".png");
			IconSet icon_set = new IconSet (pixbuf);
			icon_factory.Add (item.StockId, icon_set);
			
			Gtk.StockManager.Add (item);
		}
	}
Пример #30
0
        public FileActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory();
            fact.Add("PackageBuilderIcon", new Gtk.IconSet(Gdk.Pixbuf.LoadFromResource("TraceLab.UI.GTK.Resources.Icon_PkgBuilder16.png")));
            fact.AddDefault();

            New            = new Gtk.Action("New", Catalog.GetString("New..."), null, Stock.New);
            Open           = new Gtk.Action("Open", Catalog.GetString("Open..."), null, Stock.Open);
            Close          = new Gtk.Action("Close", Catalog.GetString("Close"), null, Stock.Close);
            Save           = new Gtk.Action("Save", Catalog.GetString("Save"), null, Stock.Save);
            SaveAs         = new Gtk.Action("SaveAs", Catalog.GetString("Save As..."), null, Stock.SaveAs);
            Exit           = new Gtk.Action("Exit", Catalog.GetString("Quit"), null, Stock.Quit);
            New            = new Gtk.Action("New", Catalog.GetString("New..."), null, Stock.New);
            Settings       = new Gtk.Action("Settings", Catalog.GetString("Settings..."), null, Stock.Properties);
            PackageBuilder = new Gtk.Action("Package Builder", Catalog.GetString("Package Builder"),
                                            "Launch Package Builder", "PackageBuilderIcon");

            New.ShortLabel   = Catalog.GetString("New");
            Open.ShortLabel  = Catalog.GetString("Open");
            Open.IsImportant = true;
            Save.IsImportant = true;

            Close.Sensitive = false;
        }
Пример #31
0
        public FileActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add ("PackageBuilderIcon", new Gtk.IconSet(Gdk.Pixbuf.LoadFromResource("TraceLab.UI.GTK.Resources.Icon_PkgBuilder16.png")));
             fact.AddDefault ();

            New = new Gtk.Action("New", Catalog.GetString("New..."), null, Stock.New);
            Open = new Gtk.Action("Open", Catalog.GetString("Open..."), null, Stock.Open);
            Close = new Gtk.Action("Close", Catalog.GetString("Close"), null, Stock.Close);
            Save = new Gtk.Action("Save", Catalog.GetString("Save"), null, Stock.Save);
            SaveAs = new Gtk.Action("SaveAs", Catalog.GetString("Save As..."), null, Stock.SaveAs);
            Exit = new Gtk.Action("Exit", Catalog.GetString("Quit"), null, Stock.Quit);
            New = new Gtk.Action("New", Catalog.GetString("New..."), null, Stock.New);
            Settings = new Gtk.Action("Settings", Catalog.GetString("Settings..."), null, Stock.Properties);
            PackageBuilder = new Gtk.Action("Package Builder", Catalog.GetString("Package Builder"), 
                                            "Launch Package Builder", "PackageBuilderIcon");

            New.ShortLabel = Catalog.GetString("New");
            Open.ShortLabel = Catalog.GetString("Open");
            Open.IsImportant = true;
            Save.IsImportant = true;

            Close.Sensitive = false;
        }
Пример #32
0
        private void LoadEffects()
        {
            // Load our adjustments
            foreach (BaseEffect effect in extensions.Effects.Where (t => t.EffectOrAdjustment == EffectAdjustment.Adjustment).OrderBy (t => t.Text)) {
                // Add icon to IconFactory
                Gtk.IconFactory fact = new Gtk.IconFactory ();
                fact.Add (effect.Icon, new Gtk.IconSet (PintaCore.Resources.GetIcon (effect.Icon)));
                fact.AddDefault ();

                // Create a gtk action for each adjustment
                Gtk.Action act = new Gtk.Action (effect.GetType ().Name, effect.Text, string.Empty, effect.Icon);
                PintaCore.Actions.Adjustments.Actions.Add (act);
                act.Activated += delegate (object sender, EventArgs e) { PintaCore.LivePreview.Start (extensions.Effects.Where (t => t.GetType ().Name == (sender as Gtk.Action).Name).First ()); };

                // Create a menu item for each adjustment
                ((Menu)((ImageMenuItem)main_menu.Children[5]).Submenu).Append (act.CreateAcceleratedMenuItem (effect.AdjustmentMenuKey, effect.AdjustmentMenuKeyModifiers));
            }

            // Load our effects
            foreach (BaseEffect effect in extensions.Effects.Where (t => t.EffectOrAdjustment == EffectAdjustment.Effect).OrderBy (t => string.Format ("{0}|{1}", t.EffectMenuCategory, t.Text))) {
                // Add icon to IconFactory
                Gtk.IconFactory fact = new Gtk.IconFactory ();
                fact.Add (effect.Icon, new Gtk.IconSet (PintaCore.Resources.GetIcon (effect.Icon)));
                fact.AddDefault ();

                // Create a gtk action and menu item for each effect
                Gtk.Action act = new Gtk.Action (effect.GetType ().Name, effect.Text, string.Empty, effect.Icon);
                PintaCore.Actions.Effects.AddEffect (effect.EffectMenuCategory, act);
                act.Activated += delegate (object sender, EventArgs e) { PintaCore.LivePreview.Start (extensions.Effects.Where (t => t.GetType ().Name == (sender as Gtk.Action).Name).First ()); };
            }
        }
Пример #33
0
        private void CreateDockAndPads(HBox container)
        {
            // Create canvas
            Table mainTable = new Table (2, 2, false);

            sw = new ScrolledWindow () {
                Name = "sw",
                ShadowType = ShadowType.EtchedOut
            };

            Viewport vp = new Viewport () {
                ShadowType = ShadowType.None
            };

            canvas = new PintaCanvas () {
                Name = "canvas",
                CanDefault = true,
                CanFocus = true,
                Events = (Gdk.EventMask)16134
            };

            // Dock widget
            dock = new DockFrame ();
            dock.CompactGuiLevel = 5;

            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add ("Tools.Pencil.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Tools.Pencil.png")));
            fact.Add ("Pinta.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Pinta.png")));
            fact.AddDefault ();

            // Toolbox pad
            DockItem toolbox_item = dock.AddItem ("Toolbox");
            toolbox = new ToolBoxWidget () { Name = "toolbox" };

            toolbox_item.Label = Catalog.GetString ("Tools");
            toolbox_item.Content = toolbox;
            toolbox_item.Icon = PintaCore.Resources.GetIcon ("Tools.Pencil.png");
            toolbox_item.Behavior |= DockItemBehavior.CantClose;
            toolbox_item.DefaultWidth = 65;

            Gtk.Action show_toolbox = show_pad.AppendAction ("Tools", Catalog.GetString ("Tools"), null, "Tools.Pencil.png");
            show_toolbox.Activated += delegate { toolbox_item.Visible = true; };

            // Palette pad
            DockItem palette_item = dock.AddItem ("Palette");
            color = new ColorPaletteWidget () { Name = "color" };

            palette_item.Label = Catalog.GetString ("Palette");
            palette_item.Content = color;
            palette_item.Icon = PintaCore.Resources.GetIcon ("Pinta.png");
            palette_item.DefaultLocation = "Toolbox/Bottom";
            palette_item.Behavior |= DockItemBehavior.CantClose;
            palette_item.DefaultWidth = 65;

            Gtk.Action show_palette = show_pad.AppendAction ("Palette", Catalog.GetString ("Palette"), null, "Pinta.png");
            show_palette.Activated += delegate { palette_item.Visible = true; };

            // Canvas pad
            DockItem documentDockItem = dock.AddItem ("Canvas");
            documentDockItem.Behavior = DockItemBehavior.Locked;
            documentDockItem.Expand = true;

            documentDockItem.DrawFrame = false;
            documentDockItem.Label = Catalog.GetString ("Documents");
            documentDockItem.Content = mainTable;

            //rulers
            hruler = new HRuler ();
            hruler.Metric = MetricType.Pixels;
            mainTable.Attach (hruler, 1, 2, 0, 1, AttachOptions.Shrink | AttachOptions.Fill, AttachOptions.Shrink | AttachOptions.Fill, 0, 0);

            vruler = new VRuler ();
            vruler.Metric = MetricType.Pixels;
            mainTable.Attach (vruler, 0, 1, 1, 2, AttachOptions.Shrink | AttachOptions.Fill, AttachOptions.Shrink | AttachOptions.Fill, 0, 0);

            sw.Hadjustment.ValueChanged += delegate {
                UpdateRulerRange ();
            };

            sw.Vadjustment.ValueChanged += delegate {
                UpdateRulerRange ();
            };

            PintaCore.Workspace.CanvasSizeChanged += delegate {
                UpdateRulerRange ();
            };

            canvas.MotionNotifyEvent += delegate (object o, MotionNotifyEventArgs args) {
                if (!PintaCore.Workspace.HasOpenDocuments)
                    return;

                Cairo.PointD point = PintaCore.Workspace.WindowPointToCanvas (args.Event.X, args.Event.Y);

                hruler.Position = point.X;
                vruler.Position = point.Y;

            };
            mainTable.Attach (sw, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

            sw.Add (vp);
            vp.Add (canvas);

            mainTable.ShowAll ();
            canvas.Show ();
            vp.Show ();

            HideRulers();

            // Layer pad
            layers = new LayersListWidget ();
            DockItem layers_item = dock.AddItem ("Layers");
            DockItemToolbar layers_tb = layers_item.GetToolbar (PositionType.Bottom);

            layers_item.Label = Catalog.GetString ("Layers");
            layers_item.Content = layers;
            layers_item.Icon = PintaCore.Resources.GetIcon ("Menu.Layers.MergeLayerDown.png");

            layers_tb.Add (PintaCore.Actions.Layers.AddNewLayer.CreateDockToolBarItem ());
            layers_tb.Add (PintaCore.Actions.Layers.DeleteLayer.CreateDockToolBarItem ());
            layers_tb.Add (PintaCore.Actions.Layers.DuplicateLayer.CreateDockToolBarItem ());
            layers_tb.Add (PintaCore.Actions.Layers.MergeLayerDown.CreateDockToolBarItem ());
            layers_tb.Add (PintaCore.Actions.Layers.MoveLayerUp.CreateDockToolBarItem ());
            layers_tb.Add (PintaCore.Actions.Layers.MoveLayerDown.CreateDockToolBarItem ());

            Gtk.Action show_layers = show_pad.AppendAction ("Layers", Catalog.GetString ("Layers"), null, "Menu.Layers.MergeLayerDown.png");
            show_layers.Activated += delegate { layers_item.Visible = true; };

            // History pad
            HistoryTreeView history = new HistoryTreeView ();
            DockItem history_item = dock.AddItem ("History");
            DockItemToolbar history_tb = history_item.GetToolbar (PositionType.Bottom);

            history_item.Label = Catalog.GetString ("History");
            history_item.DefaultLocation = "Layers/Bottom";
            history_item.Content = history;
            history_item.Icon = PintaCore.Resources.GetIcon ("Menu.Layers.DuplicateLayer.png");

            history_tb.Add (PintaCore.Actions.Edit.Undo.CreateDockToolBarItem ());
            history_tb.Add (PintaCore.Actions.Edit.Redo.CreateDockToolBarItem ());

            Gtk.Action show_history = show_pad.AppendAction ("History", Catalog.GetString ("History"), null, "Menu.Layers.DuplicateLayer.png");
            show_history.Activated += delegate { history_item.Visible = true; };

            container.PackStart (dock, true, true, 0);

            string layout_file = System.IO.Path.Combine (PintaCore.Settings.GetUserSettingsDirectory (), "layouts.xml");

            if (System.IO.File.Exists (layout_file))
                dock.LoadLayouts (layout_file);

            if (!dock.HasLayout ("Default"))
                dock.CreateLayout ("Default", false);

            dock.CurrentLayout = "Default";
        }
Пример #34
0
        public EffectsActions()
        {
            IconFactory fact = new IconFactory ();
            fact.Add ("Menu.Effects.Artistic.InkSketch.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Artistic.InkSketch.png")));
            fact.Add ("Menu.Effects.Artistic.OilPainting.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Artistic.OilPainting.png")));
            fact.Add ("Menu.Effects.Artistic.PencilSketch.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Artistic.PencilSketch.png")));
            fact.Add ("Menu.Effects.Blurs.Fragment.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.Fragment.png")));
            fact.Add ("Menu.Effects.Blurs.GaussianBlur.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.GaussianBlur.png")));
            fact.Add ("Menu.Effects.Blurs.MotionBlur.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.MotionBlur.png")));
            fact.Add ("Menu.Effects.Blurs.RadialBlur.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.RadialBlur.png")));
            fact.Add ("Menu.Effects.Blurs.SurfaceBlur.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.SurfaceBlur.png")));
            fact.Add ("Menu.Effects.Blurs.Unfocus.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.Unfocus.png")));
            fact.Add ("Menu.Effects.Blurs.ZoomBlur.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.ZoomBlur.png")));
            fact.Add ("Menu.Effects.Photo.Glow.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Photo.Glow.png")));
            fact.AddDefault ();

            // Submenus
            Artistic = new Gtk.Action ("Artistic", Mono.Unix.Catalog.GetString ("Artistic"), null, null);
            Blurs = new Gtk.Action ("Blurs", Mono.Unix.Catalog.GetString ("Blurs"), null, null);
            Distort = new Gtk.Action ("Distort", Mono.Unix.Catalog.GetString ("Distort"), null, null);
            Noise = new Gtk.Action ("Noise", Mono.Unix.Catalog.GetString ("Noise"), null, null);
            Photo = new Gtk.Action ("Photo", Mono.Unix.Catalog.GetString ("Photo"), null, null);
            Render = new Gtk.Action ("Render", Mono.Unix.Catalog.GetString ("Render"), null, null);
            Stylize = new Gtk.Action ("Stylize", Mono.Unix.Catalog.GetString ("Stylize"), null, null);

            Distort.Visible = false;
            Noise.Visible = false;
            Render.Visible = false;
            Stylize.Visible = false;

            // Menu items
            InkSketch = new Gtk.Action ("InkSketch", Mono.Unix.Catalog.GetString ("Ink Sketch..."), null, "Menu.Effects.Artistic.InkSketch.png");
            OilPainting = new Gtk.Action ("OilPainting", Mono.Unix.Catalog.GetString ("Oil Painting..."), null, "Menu.Effects.Artistic.OilPainting.png");
            PencilSketch = new Gtk.Action ("PencilSketch", Mono.Unix.Catalog.GetString ("Pencil Sketch..."), null, "Menu.Effects.Artistic.PencilSketch.png");
            GaussianBlur = new Gtk.Action ("GaussianBlur", Mono.Unix.Catalog.GetString ("Gaussian Blur..."), null, "Menu.Effects.Blurs.GaussianBlur.png");
            Glow = new Gtk.Action ("Glow", Mono.Unix.Catalog.GetString ("Glow..."), null, "Menu.Effects.Photo.Glow.png");
        }
Пример #35
0
		public ViewActions ()
		{
			Gtk.IconFactory fact = new Gtk.IconFactory ();
			fact.Add ("Menu.View.ActualSize.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ActualSize.png")));
			fact.Add ("Menu.View.Grid.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.Grid.png")));
			fact.Add ("Menu.View.Rulers.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.Rulers.png")));
			fact.Add ("Menu.View.ZoomIn.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomIn.png")));
			fact.Add ("Menu.View.ZoomOut.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomOut.png")));
			fact.Add ("Menu.View.ZoomToSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomToSelection.png")));
			fact.Add ("Menu.View.ZoomToWindow.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomToWindow.png")));
			fact.AddDefault ();
			
			ZoomIn = new Gtk.Action ("ZoomIn", Catalog.GetString ("Zoom In"), null, Stock.ZoomIn);
			ZoomOut = new Gtk.Action ("ZoomOut", Catalog.GetString ("Zoom Out"), null, Stock.ZoomOut);
			ZoomToWindow = new Gtk.Action ("ZoomToWindow", Catalog.GetString ("Best Fit"), null, Stock.ZoomFit);
			ZoomToSelection = new Gtk.Action ("ZoomToSelection", Catalog.GetString ("Zoom to Selection"), null, "Menu.View.ZoomToSelection.png");
			ActualSize = new Gtk.Action ("ActualSize", Catalog.GetString ("Normal Size"), null, Stock.Zoom100);
            ToolBar = new Gtk.ToggleAction ("Toolbar", Catalog.GetString ("Toolbar"), null, null);
            ImageTabs = new Gtk.ToggleAction ("ImageTabs", Catalog.GetString ("Image Tabs"), null, null);
            PixelGrid = new Gtk.ToggleAction ("PixelGrid", Catalog.GetString ("Pixel Grid"), null, "Menu.View.Grid.png");
			Rulers = new Gtk.ToggleAction ("Rulers", Catalog.GetString ("Rulers"), null, "Menu.View.Rulers.png");
			Pixels = new Gtk.RadioAction ("Pixels", Catalog.GetString ("Pixels"), null, null, 0);
			Inches = new Gtk.RadioAction ("Inches", Catalog.GetString ("Inches"), null, null, 1);
			Centimeters = new Gtk.RadioAction ("Centimeters", Catalog.GetString ("Centimeters"), null, null, 2);
			Fullscreen = new Gtk.Action ("Fullscreen", Catalog.GetString ("Fullscreen"), null, Stock.Fullscreen);

			ZoomCollection = new string[] {
				ToPercent (36),
				ToPercent (24),
				ToPercent (16),
				ToPercent (12),
				ToPercent (8),
				ToPercent (7),
				ToPercent (6),
				ToPercent (5),
				ToPercent (4),
				ToPercent (3),
				ToPercent (2),
				ToPercent (1.75),
				ToPercent (1.5),
				ToPercent (1.25),
				ToPercent (1),
				ToPercent (0.66),
				ToPercent (0.5),
				ToPercent (0.33),
				ToPercent (0.25),
				ToPercent (0.16),
				ToPercent (0.12),
				ToPercent (0.08),
				ToPercent (0.05),
				Catalog.GetString ("Window")
			};
			ZoomComboBox = new ToolBarComboBox (90, DefaultZoomIndex(), true, ZoomCollection);

			// Make sure these are the same group so only one will be selected at a time
			Inches.Group = Pixels.Group;
			Centimeters.Group = Pixels.Group;

            // The toolbar is shown by default.
            ToolBar.Active = true;
            ImageTabs.Active = true;
		}
Пример #36
0
        public LayerActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory();
            fact.Add("Menu.Layers.AddNewLayer.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.AddNewLayer.png")));
            fact.Add("Menu.Layers.DeleteLayer.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.DeleteLayer.png")));
            fact.Add("Menu.Layers.DuplicateLayer.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.DuplicateLayer.png")));
            fact.Add("Menu.Layers.MergeLayerDown.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.MergeLayerDown.png")));
            fact.Add("Menu.Layers.MoveLayerDown.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.MoveLayerDown.png")));
            fact.Add("Menu.Layers.MoveLayerUp.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.MoveLayerUp.png")));
            fact.Add("Menu.Layers.FlipHorizontal.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.FlipHorizontal.png")));
            fact.Add("Menu.Layers.FlipVertical.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.FlipVertical.png")));
            fact.Add("Menu.Layers.ImportFromFile.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.ImportFromFile.png")));
            fact.Add("Menu.Layers.LayerProperties.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.LayerProperties.png")));
            fact.Add("Menu.Layers.RotateZoom.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.RotateZoom.png")));
            fact.AddDefault();

            AddNewLayer    = new Gtk.Action("AddNewLayer", Catalog.GetString("Add New Layer"), null, "Menu.Layers.AddNewLayer.png");
            DeleteLayer    = new Gtk.Action("DeleteLayer", Catalog.GetString("Delete Layer"), null, "Menu.Layers.DeleteLayer.png");
            DuplicateLayer = new Gtk.Action("DuplicateLayer", Catalog.GetString("Duplicate Layer"), null, "Menu.Layers.DuplicateLayer.png");
            MergeLayerDown = new Gtk.Action("MergeLayerDown", Catalog.GetString("Merge Layer Down"), null, "Menu.Layers.MergeLayerDown.png");
            ImportFromFile = new Gtk.Action("ImportFromFile", Catalog.GetString("Import from File..."), null, "Menu.Layers.ImportFromFile.png");
            FlipHorizontal = new Gtk.Action("FlipHorizontal", Catalog.GetString("Flip Horizontal"), null, "Menu.Layers.FlipHorizontal.png");
            FlipVertical   = new Gtk.Action("FlipVertical", Catalog.GetString("Flip Vertical"), null, "Menu.Layers.FlipVertical.png");
            RotateZoom     = new Gtk.Action("RotateZoom", Catalog.GetString("Rotate / Zoom Layer..."), null, "Menu.Layers.RotateZoom.png");
            MoveLayerUp    = new Gtk.Action("MoveLayerUp", Catalog.GetString("Move Layer Up"), null, "Menu.Layers.MoveLayerUp.png");
            MoveLayerDown  = new Gtk.Action("MoveLayerDown", Catalog.GetString("Move Layer Down"), null, "Menu.Layers.MoveLayerDown.png");
            Properties     = new Gtk.Action("Properties", Catalog.GetString("Layer Properties..."), null, "Menu.Layers.LayerProperties.png");

            RotateZoom.Sensitive = false;
        }
Пример #37
0
        /// <summary>
        /// Register a new effect with Pinta, causing it to be added to the Effects menu.
        /// </summary>
        /// <param name="effect">The effect to register</param>
        /// <returns>The action created for this effect</returns>
        public Gtk.Action RegisterEffect(BaseEffect effect)
        {
            // Add icon to IconFactory
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add (effect.Icon, new Gtk.IconSet (PintaCore.Resources.GetIcon (effect.Icon)));
            fact.AddDefault ();

            // Create a gtk action and menu item for each effect
            Gtk.Action act = new Gtk.Action (effect.GetType ().Name, effect.Name + (effect.IsConfigurable ? Catalog.GetString ("...") : ""), string.Empty, effect.Icon);
            act.Activated += delegate (object sender, EventArgs e) { PintaCore.LivePreview.Start (effect); };

            PintaCore.Actions.Effects.AddEffect (effect.EffectMenuCategory, act);

            effects.Add (effect, act);

            return act;
        }
Пример #38
0
        private void CreateDockAndPads(HBox container)
        {
            // Create canvas
            sw = new ScrolledWindow () {
                Name = "sw",
                ShadowType = ShadowType.EtchedOut
            };

            Viewport vp = new Viewport () {
                ShadowType = ShadowType.None
            };

            canvas = new PintaCanvas () {
                Name = "canvas",
                CanDefault = true,
                CanFocus = true,
                Events = (Gdk.EventMask)16134
            };

            // Dock widget
            dock = new DockFrame ();
            dock.CompactGuiLevel = 5;

            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add ("Tools.Pencil.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Tools.Pencil.png")));
            fact.Add ("Pinta.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Pinta.png")));
            fact.AddDefault ();

            // Toolbox pad
            DockItem toolbox_item = dock.AddItem ("Toolbox");
            toolbox = new ToolBoxWidget () { Name = "toolbox" };

            toolbox_item.Label = Catalog.GetString ("Tools");
            toolbox_item.Content = toolbox;
            toolbox_item.Icon = PintaCore.Resources.GetIcon ("Tools.Pencil.png");
            toolbox_item.Behavior |= DockItemBehavior.CantClose;
            toolbox_item.DefaultWidth = 65;

            Gtk.Action show_toolbox = show_pad.AppendAction ("Tools", Catalog.GetString ("Tools"), null, "Tools.Pencil.png");
            show_toolbox.Activated += delegate { toolbox_item.Visible = true; };

            // Palette pad
            DockItem palette_item = dock.AddItem ("Palette");
            color = new ColorPaletteWidget () { Name = "color" };

            palette_item.Label = Catalog.GetString ("Palette");
            palette_item.Content = color;
            palette_item.Icon = PintaCore.Resources.GetIcon ("Pinta.png");
            palette_item.DefaultLocation = "Toolbox/Bottom";
            palette_item.Behavior |= DockItemBehavior.CantClose;
            palette_item.DefaultWidth = 65;

            Gtk.Action show_palette = show_pad.AppendAction ("Palette", Catalog.GetString ("Palette"), null, "Pinta.png");
            show_palette.Activated += delegate { palette_item.Visible = true; };

            // Canvas pad
            DockItem documentDockItem = dock.AddItem ("Canvas");
            documentDockItem.Behavior = DockItemBehavior.Locked;
            documentDockItem.Expand = true;

            documentDockItem.DrawFrame = false;
            documentDockItem.Label = Catalog.GetString ("Documents");
            documentDockItem.Content = sw;

            sw.Add (vp);
            vp.Add (canvas);

            canvas.Show ();
            vp.Show ();

            // Layer pad
            LayersListWidget layers = new LayersListWidget ();
            DockItem layers_item = dock.AddItem ("Layers");
            DockItemToolbar layers_tb = layers_item.GetToolbar (PositionType.Bottom);

            layers_item.Label = Catalog.GetString ("Layers");
            layers_item.Content = layers;
            layers_item.Icon = PintaCore.Resources.GetIcon ("Menu.Layers.MergeLayerDown.png");

            layers_tb.Add (PintaCore.Actions.Layers.AddNewLayer.CreateDockToolBarItem ());
            layers_tb.Add (PintaCore.Actions.Layers.DeleteLayer.CreateDockToolBarItem ());
            layers_tb.Add (PintaCore.Actions.Layers.DuplicateLayer.CreateDockToolBarItem ());
            layers_tb.Add (PintaCore.Actions.Layers.MergeLayerDown.CreateDockToolBarItem ());
            layers_tb.Add (PintaCore.Actions.Layers.MoveLayerUp.CreateDockToolBarItem ());
            layers_tb.Add (PintaCore.Actions.Layers.MoveLayerDown.CreateDockToolBarItem ());

            Gtk.Action show_layers = show_pad.AppendAction ("Layers", Catalog.GetString ("Layers"), null, "Menu.Layers.MergeLayerDown.png");
            show_layers.Activated += delegate { layers_item.Visible = true; };

            // History pad
            HistoryTreeView history = new HistoryTreeView ();
            DockItem history_item = dock.AddItem ("History");
            DockItemToolbar history_tb = history_item.GetToolbar (PositionType.Bottom);

            history_item.Label = Catalog.GetString ("History");
            history_item.DefaultLocation = "Layers/Bottom";
            history_item.Content = history;
            history_item.Icon = PintaCore.Resources.GetIcon ("Menu.Layers.DuplicateLayer.png");

            history_tb.Add (PintaCore.Actions.Edit.Undo.CreateDockToolBarItem ());
            history_tb.Add (PintaCore.Actions.Edit.Redo.CreateDockToolBarItem ());

            Gtk.Action show_history = show_pad.AppendAction ("History", Catalog.GetString ("History"), null, "Menu.Layers.DuplicateLayer.png");
            show_history.Activated += delegate { history_item.Visible = true; };

            container.PackStart (dock, true, true, 0);

            string layout_file = System.IO.Path.Combine (PintaCore.Settings.GetUserSettingsDirectory (), "layouts.xml");

            if (System.IO.File.Exists (layout_file))
                dock.LoadLayouts (layout_file);

            if (!dock.HasLayout ("Default"))
                dock.CreateLayout ("Default", false);

            dock.CurrentLayout = "Default";
        }
Пример #39
0
        // ============================================
        // PUBLIC Methods
        // ============================================
        /// Initialize NyFolder Stock Icons (Only Main() Call This)
        public static void Initialize()
        {
            Gtk.IconFactory factory = new Gtk.IconFactory();
            factory.AddDefault();

            // Stock Icons
            foreach (string name in stock_icons) {
                Gdk.Pixbuf pixbuf = new Gdk.Pixbuf(null, name + ".png");
                Gtk.IconSet iconset = new Gtk.IconSet(pixbuf);

                factory.Add(name, iconset);
            }

            // Stock Images
            stock_images = Hashtable.Synchronized(new Hashtable());
            foreach (string name in stock_images_names) {
                stock_images.Add(name, new Gdk.Pixbuf(null, name + ".png"));
            }
        }
Пример #40
0
        public LayerActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add ("Menu.Layers.AddNewLayer.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.AddNewLayer.png")));
            fact.Add ("Menu.Layers.DeleteLayer.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.DeleteLayer.png")));
            fact.Add ("Menu.Layers.DuplicateLayer.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.DuplicateLayer.png")));
            fact.Add ("Menu.Layers.MergeLayerDown.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.MergeLayerDown.png")));
            fact.Add ("Menu.Layers.MoveLayerDown.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.MoveLayerDown.png")));
            fact.Add ("Menu.Layers.MoveLayerUp.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.MoveLayerUp.png")));
            fact.Add ("Menu.Layers.FlipHorizontal.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.FlipHorizontal.png")));
            fact.Add ("Menu.Layers.FlipVertical.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.FlipVertical.png")));
            fact.Add ("Menu.Layers.ImportFromFile.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.ImportFromFile.png")));
            fact.Add ("Menu.Layers.LayerProperties.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.LayerProperties.png")));
            fact.Add ("Menu.Layers.RotateZoom.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.RotateZoom.png")));
            fact.AddDefault ();

            AddNewLayer = new Gtk.Action ("AddNewLayer", Catalog.GetString ("Add New Layer"), null, "Menu.Layers.AddNewLayer.png");
            DeleteLayer = new Gtk.Action ("DeleteLayer", Catalog.GetString ("Delete Layer"), null, "Menu.Layers.DeleteLayer.png");
            DuplicateLayer = new Gtk.Action ("DuplicateLayer", Catalog.GetString ("Duplicate Layer"), null, "Menu.Layers.DuplicateLayer.png");
            MergeLayerDown = new Gtk.Action ("MergeLayerDown", Catalog.GetString ("Merge Layer Down"), null, "Menu.Layers.MergeLayerDown.png");
            ImportFromFile = new Gtk.Action ("ImportFromFile", Catalog.GetString ("Import from File..."), null, "Menu.Layers.ImportFromFile.png");
            FlipHorizontal = new Gtk.Action ("FlipHorizontal", Catalog.GetString ("Flip Horizontal"), null, "Menu.Layers.FlipHorizontal.png");
            FlipVertical = new Gtk.Action ("FlipVertical", Catalog.GetString ("Flip Vertical"), null, "Menu.Layers.FlipVertical.png");
            RotateZoom = new Gtk.Action ("RotateZoom", Catalog.GetString ("Rotate / Zoom"), null, "Menu.Layers.RotateZoom.png");
            MoveLayerUp = new Gtk.Action ("MoveLayerUp", Catalog.GetString ("Move Layer Up"), null, "Menu.Layers.MoveLayerUp.png");
            MoveLayerDown = new Gtk.Action ("MoveLayerDown", Catalog.GetString ("Move Layer Down"), null, "Menu.Layers.MoveLayerDown.png");
            Properties = new Gtk.Action ("Properties", Catalog.GetString ("Layer Properties..."), null, "Menu.Layers.LayerProperties.png");

            RotateZoom.Sensitive = false;
        }
Пример #41
0
 private void AddToToolbar(BaseTemplate i)
 {
     var w1 = new IconFactory();
     var w2 = new IconSet(new Pixbuf(
         Assembly.GetExecutingAssembly(),
         i.GetIcon()));
     w1.Add(i.Type + "_icon", w2);
     w1.AddDefault();
     var act = new Gtk.Action("c_Create" + i.Type + "Action", null, "Create " + i.Type + " Project", null);
     act.Activated +=
         (object sender, System.EventArgs e) =>
             { this.PromptCreateProject(i.Type); };
     var t = act.CreateToolItem();
     (t as ToolButton).StockId = i.Type + "_icon";
     this.c_Toolbar.Add(t);
 }
Пример #42
0
        private void CreateDockAndPads(HBox container)
        {
            Gtk.IconFactory fact = new Gtk.IconFactory();
            fact.Add("Tools.Pencil.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Tools.Pencil.png")));
            fact.Add("Pinta.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Pinta.png")));
            fact.AddDefault();

            // Dock widget
            dock = new DockFrame();
            dock.CompactGuiLevel = 5;

            // Toolbox pad
            var toolboxpad = new ToolBoxPad();

            toolboxpad.Initialize(dock, show_pad);

            // Palette pad
            var palettepad = new ColorPalettePad();

            palettepad.Initialize(dock, show_pad);

            // Canvas pad
            canvas_pad = new CanvasPad();
            canvas_pad.Initialize(dock, show_pad);

            sw = canvas_pad.ScrolledWindow;

            // Layer pad
            var layers_pad = new LayersPad();

            layers_pad.Initialize(dock, show_pad);

            // Open Images pad
            var open_images_pad = new OpenImagesPad();

            open_images_pad.Initialize(dock, show_pad);

            // History pad
            var history_pad = new HistoryPad();

            history_pad.Initialize(dock, show_pad);

            container.PackStart(dock, true, true, 0);

            string layout_file = System.IO.Path.Combine(PintaCore.Settings.GetUserSettingsDirectory(), "layouts.xml");

            if (System.IO.File.Exists(layout_file))
            {
                try
                {
                    dock.LoadLayouts(layout_file);
                }
                // If parsing layouts.xml fails for some reason, proceed to create the default layout.
                catch (Exception e)
                {
                    System.Console.Error.WriteLine("Error reading layouts.xml: " + e.ToString());
                }
            }

            if (!dock.HasLayout("Default"))
            {
                dock.CreateLayout("Default", false);
            }

            dock.CurrentLayout = "Default";
        }
Пример #43
0
        public static void Load(string themePath)
        {
            if (themePath == null)
                throw new ArgumentNullException("themePath");

            if (themePath.Length == 0)
                throw new ArgumentException("Argument is empty", "themePath");

            // gtk requires an absolute path
            if (!Path.IsPathRooted(themePath))
                throw new ArgumentException("Path must be absolute", "themePath");

            if (!Directory.Exists(themePath))
                throw new DirectoryNotFoundException(string.Format("Path to theme \"{0}\" not found", themePath));

            //IconSize[]				  iconSizes   = (IconSize[])Enum.GetValues(typeof(IconSize));

            // all icon sizes the app uses
            IconSize[] iconSizes =	{	IconSize.Menu,			/* 16px */
                                        IconSize.LargeToolbar,	/* 24px */
                                        IconSize.Button,		/* 24px */
                                        IconSize.Dialog			/* 48px */
                                    };

            Dictionary<string, string>	iconNames	= GetAllIconNames();
            IconFactory					fac			= new IconFactory();

            foreach (KeyValuePair<string, string> namePair in iconNames) {

                string	name				= namePair.Key;
                string	nameInCustomTheme	= namePair.Value;
                IconSet iconSet				= new IconSet();
                bool	setHasSources		= false;

                foreach (Gtk.IconSize size in iconSizes) {

                    int    sz		= IconUtils.GetIconSizeVal(size);
                    string fullPath = Path.Combine(Path.Combine(themePath, sz.ToString()), nameInCustomTheme);

                    if (!File.Exists(fullPath)) {
                        if (Global.EnableDebugging) {
                            Debug.WriteLine(string.Format("IconTheme: could not find custom icon for \"{0}\" (size = {1}), using system default", name, sz));
                        }
                        continue;
                    }

                    IconSource source = new IconSource();

            #if LOAD_PIXBUFS
                    source.Pixbuf = new Gdk.Pixbuf(fullPath);
            #else
                    source.Filename = fullPath;
            #endif

                    source.Size = size;
                    //source.IconName = name;
                    source.SizeWildcarded = false;

                    iconSet.AddSource(source);
                    setHasSources = true;
                }
                if (setHasSources)
                    fac.Add(name, iconSet);
            }

            fac.AddDefault(); // add icon factory to the apps default factories
        }
Пример #44
0
        private void CreateDockAndPads(HBox container)
        {
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add ("Tools.Pencil.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Tools.Pencil.png")));
            fact.Add ("Pinta.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Pinta.png")));
            fact.AddDefault ();

            // Dock widget
            dock = new DockFrame ();
            dock.CompactGuiLevel = 5;

            // Toolbox pad
            var toolboxpad = new ToolBoxPad ();
            toolboxpad.Initialize (dock, show_pad);

            // Palette pad
            var palettepad = new ColorPalettePad ();
            palettepad.Initialize (dock, show_pad);

            // Canvas pad
            var canvas_pad = new CanvasPad ();
            canvas_pad.Initialize (dock, show_pad);

            sw = canvas_pad.ScrolledWindow;

            // Layer pad
            var layers_pad = new LayersPad ();
            layers_pad.Initialize (dock, show_pad);

            // History pad
            var history_pad = new HistoryPad ();
            history_pad.Initialize (dock, show_pad);

            container.PackStart (dock, true, true, 0);

            string layout_file = System.IO.Path.Combine (PintaCore.Settings.GetUserSettingsDirectory (), "layouts.xml");

            if (System.IO.File.Exists (layout_file))
                dock.LoadLayouts (layout_file);

            if (!dock.HasLayout ("Default"))
                dock.CreateLayout ("Default", false);

            dock.CurrentLayout = "Default";
        }
Пример #45
0
        private void CreateDockAndPads(HBox container)
        {
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add ("Tools.Pencil.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Tools.Pencil.png")));
            fact.Add ("Pinta.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Pinta.png")));
            fact.AddDefault ();

            // Dock widget
            dock = new DockFrame ();
            dock.CompactGuiLevel = 5;

            // Toolbox pad
            //var toolboxpad = new ToolBoxPad ();
            //toolboxpad.Initialize (dock, show_pad);

            // Palette pad
            var palettepad = new ColorPalettePad ();
            palettepad.Initialize (dock, show_pad);

            // Canvas pad
            canvas_pad = new CanvasPad ();
            canvas_pad.Initialize (dock, show_pad);

            sw = canvas_pad.ScrolledWindow;

            // Layer pad
            var layers_pad = new LayersPad ();
            layers_pad.Initialize (dock, show_pad);

            // Open Images pad
            var open_images_pad = new OpenImagesPad ();
            open_images_pad.Initialize (dock, show_pad);

            // History pad
            var history_pad = new HistoryPad ();
            history_pad.Initialize (dock, show_pad);

            container.PackStart (dock, true, true, 0);

            dock.CreateLayout ("Default", false);
            dock.CurrentLayout = "Default";
        }
Пример #46
0
 /// Add New Pixbuf to Stock
 public static void AddToStock(string name, Gdk.Pixbuf pixbuf)
 {
     Gtk.IconFactory factory = new Gtk.IconFactory();
     factory.AddDefault();
     Gtk.IconSet iconset = new Gtk.IconSet(pixbuf);
     factory.Add(name, iconset);
 }
Пример #47
0
        static void AddIcon(IconFactory stock, string stockid, string resource)
        {
            Gtk.IconSet iconset = stock.Lookup (stockid);

            if (iconset != null)
                return;

            iconset = new Gtk.IconSet ();
            Gdk.Pixbuf img = Gdk.Pixbuf.LoadFromResource (resource);
            IconSource source = new IconSource ();
            source.Pixbuf = img;
            iconset.AddSource (source);
            stock.Add (stockid, iconset);
        }
Пример #48
0
        private void CreateDockAndPads(HBox container)
        {
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add ("Tools.Pencil.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Tools.Pencil.png")));
            fact.Add ("Pinta.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Pinta.png")));
            fact.AddDefault ();

            // Dock widget
            dock = new DockFrame ();
            dock.CompactGuiLevel = 5;

            // Toolbox pad
            var toolboxpad = new ToolBoxPad ();
            toolboxpad.Initialize (dock, show_pad);

            // Palette pad
            var palettepad = new ColorPalettePad ();
            palettepad.Initialize (dock, show_pad);

            // Canvas pad
            var canvas_pad = new CanvasPad ();
            canvas_pad.Initialize (dock, show_pad);

            sw = canvas_pad.ScrolledWindow;

            // Layer pad
            var layers_pad = new LayersPad ();
            layers_pad.Initialize (dock, show_pad);

            // History pad
            var history_pad = new HistoryPad ();
            history_pad.Initialize (dock, show_pad);

            // Open Images pad
            var open_images_pad = new OpenImagesPad ();
            open_images_pad.Initialize (dock, show_pad);

            container.PackStart (dock, true, true, 0);

            string layout_file = System.IO.Path.Combine (PintaCore.Settings.GetUserSettingsDirectory (), "layouts.xml");

            if (System.IO.File.Exists(layout_file))
            {
                try
                {
                    dock.LoadLayouts(layout_file);
                }
                // If parsing layouts.xml fails for some reason, proceed to create the default layout.
                catch (Exception e)
                {
                    System.Console.Error.WriteLine ("Error reading layouts.xml: " + e.ToString());
                }
            }

            if (!dock.HasLayout ("Default"))
                dock.CreateLayout ("Default", false);

            dock.CurrentLayout = "Default";
        }
Пример #49
0
        public EffectsActions()
        {
            IconFactory fact = new IconFactory ();
            fact.Add ("Menu.Effects.Artistic.InkSketch.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Artistic.InkSketch.png")));
            fact.Add ("Menu.Effects.Artistic.OilPainting.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Artistic.OilPainting.png")));
            fact.Add ("Menu.Effects.Artistic.PencilSketch.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Artistic.PencilSketch.png")));
            fact.Add ("Menu.Effects.Blurs.Fragment.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.Fragment.png")));
            fact.Add ("Menu.Effects.Blurs.GaussianBlur.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.GaussianBlur.png")));
            fact.Add ("Menu.Effects.Blurs.MotionBlur.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.MotionBlur.png")));
            fact.Add ("Menu.Effects.Blurs.RadialBlur.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.RadialBlur.png")));
            fact.Add ("Menu.Effects.Blurs.SurfaceBlur.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.SurfaceBlur.png")));
            fact.Add ("Menu.Effects.Blurs.Unfocus.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.Unfocus.png")));
            fact.Add ("Menu.Effects.Blurs.ZoomBlur.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.ZoomBlur.png")));
            fact.Add ("Menu.Effects.Distort.Bulge.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Distort.Bulge.png")));
            fact.Add ("Menu.Effects.Distort.Dents.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Distort.Dents.png")));
            fact.Add ("Menu.Effects.Distort.PolarInversion.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Distort.PolarInversion.png")));
            fact.Add ("Menu.Effects.Distort.Twist.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Distort.Twist.png")));
            fact.Add ("Menu.Effects.Distort.Tile.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Distort.Tile.png")));
            fact.Add ("Menu.Effects.Distort.FrostedGlass.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Distort.FrostedGlass.png")));
            fact.Add ("Menu.Effects.Distort.Pixelate.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Distort.Pixelate.png")));
            fact.Add ("Menu.Effects.Photo.Glow.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Photo.Glow.png")));
            fact.Add ("Menu.Effects.Photo.RedEyeRemove.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Photo.RedEyeRemove.png")));
            fact.Add ("Menu.Effects.Photo.Sharpen.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Photo.Sharpen.png")));
            fact.Add ("Menu.Effects.Photo.SoftenPortrait.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Photo.SoftenPortrait.png")));
            fact.Add ("Menu.Effects.Render.Clouds.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Render.Clouds.png")));
            fact.Add ("Menu.Effects.Render.JuliaFractal.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Render.JuliaFractal.png")));
            fact.Add ("Menu.Effects.Render.MandelbrotFractal.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Render.MandelbrotFractal.png")));
            fact.Add ("Menu.Effects.Noise.AddNoise.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Noise.AddNoise.png")));
            fact.Add ("Menu.Effects.Noise.Median.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Noise.Median.png")));
            fact.Add ("Menu.Effects.Noise.ReduceNoise.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Noise.ReduceNoise.png")));
            fact.Add ("Menu.Effects.Stylize.EdgeDetect.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Stylize.EdgeDetect.png")));
            fact.Add ("Menu.Effects.Stylize.Relief.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Stylize.Relief.png")));
            fact.Add ("Menu.Effects.Stylize.Emboss.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Stylize.Emboss.png")));
            fact.Add ("Menu.Effects.Stylize.Outline.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Stylize.Outline.png")));

            fact.AddDefault ();

            // Submenus
            Artistic = new Gtk.Action ("Artistic", Mono.Unix.Catalog.GetString ("Artistic"), null, null);
            Blurs = new Gtk.Action ("Blurs", Mono.Unix.Catalog.GetString ("Blurs"), null, null);
            Distort = new Gtk.Action ("Distort", Mono.Unix.Catalog.GetString ("Distort"), null, null);
            Noise = new Gtk.Action ("Noise", Mono.Unix.Catalog.GetString ("Noise"), null, null);
            Photo = new Gtk.Action ("Photo", Mono.Unix.Catalog.GetString ("Photo"), null, null);
            Render = new Gtk.Action ("Render", Mono.Unix.Catalog.GetString ("Render"), null, null);
            Stylize = new Gtk.Action ("Stylize", Mono.Unix.Catalog.GetString ("Stylize"), null, null);

            // Menu items
            InkSketch = new Gtk.Action ("InkSketch", Mono.Unix.Catalog.GetString ("Ink Sketch..."), null, "Menu.Effects.Artistic.InkSketch.png");
            OilPainting = new Gtk.Action ("OilPainting", Mono.Unix.Catalog.GetString ("Oil Painting..."), null, "Menu.Effects.Artistic.OilPainting.png");
            PencilSketch = new Gtk.Action ("PencilSketch", Mono.Unix.Catalog.GetString ("Pencil Sketch..."), null, "Menu.Effects.Artistic.PencilSketch.png");
            Fragment = new Gtk.Action ("Fragment", Mono.Unix.Catalog.GetString ("Fragment..."), null, "Menu.Effects.Blurs.Fragment.png");
            GaussianBlur = new Gtk.Action ("GaussianBlur", Mono.Unix.Catalog.GetString ("Gaussian Blur..."), null, "Menu.Effects.Blurs.GaussianBlur.png");
            SurfaceBlur = new Gtk.Action ("SurfaceBlur", Mono.Unix.Catalog.GetString ("Surface Blur..."), null, "Menu.Effects.Blurs.SurfaceBlur.png");
            ZoomBlur = new Gtk.Action ("ZoomBlur", Mono.Unix.Catalog.GetString ("Zoom Blur..."), null, "Menu.Effects.Blurs.ZoomBlur.png");
            Unfocus = new Gtk.Action ("Unfocus", Mono.Unix.Catalog.GetString ("Unfocus..."), null, "Menu.Effects.Blurs.Unfocus.png");
            Glow = new Gtk.Action ("Glow", Mono.Unix.Catalog.GetString ("Glow..."), null, "Menu.Effects.Photo.Glow.png");
            RadialBlur = new Gtk.Action ("RadialBlur", Mono.Unix.Catalog.GetString ("Radial Blur..."), null, "Menu.Effects.Blurs.RadialBlur.png");
            Bulge = new Gtk.Action ("Bulge", Mono.Unix.Catalog.GetString ("Bulge..."), null, "Menu.Effects.Distort.Bulge.png");
            Twist = new Gtk.Action ("Twist", Mono.Unix.Catalog.GetString ("Twist..."), null, "Menu.Effects.Distort.Twist.png");
            Tile = new Gtk.Action ("Tile", Mono.Unix.Catalog.GetString ("Tile Reflection..."), null, "Menu.Effects.Distort.Tile.png");
            FrostedGlass = new Gtk.Action ("FrostedGlass", Mono.Unix.Catalog.GetString ("Frosted Glass..."), null, "Menu.Effects.Distort.FrostedGlass.png");
            Pixelate = new Gtk.Action ("Pixelate", Mono.Unix.Catalog.GetString ("Pixelate..."), null, "Menu.Effects.Distort.Pixelate.png");
            Dents = new Gtk.Action ("Dents", Mono.Unix.Catalog.GetString ("Dents..."), null, "Menu.Effects.Distort.Dents.png");
            PolarInversion = new Gtk.Action ("PolarInversion", Mono.Unix.Catalog.GetString ("Polar Inversion..."), null, "Menu.Effects.Distort.PolarInversion.png");
            MotionBlur = new Gtk.Action ("MotionBlur", Mono.Unix.Catalog.GetString ("Motion Blur..."), null, "Menu.Effects.Blurs.MotionBlur.png");
            Glow = new Gtk.Action ("Glow", Mono.Unix.Catalog.GetString ("Glow..."), null, "Menu.Effects.Photo.Glow.png");
            RedEyeRemove = new Gtk.Action ("RedEyeRemove", Mono.Unix.Catalog.GetString ("Red Eye Removal..."), null, "Menu.Effects.Photo.RedEyeRemove.png");
            Sharpen = new Gtk.Action ("Sharpen", Mono.Unix.Catalog.GetString ("Sharpen..."), null, "Menu.Effects.Photo.Sharpen.png");
            SoftenPortrait = new Gtk.Action ("Soften Portrait", Mono.Unix.Catalog.GetString ("Soften Portrait..."), null, "Menu.Effects.Photo.SoftenPortrait.png");
            Clouds = new Gtk.Action ("Clouds", Mono.Unix.Catalog.GetString ("Clouds..."), null, "Menu.Effects.Render.Clouds.png");
            JuliaFractal = new Gtk.Action ("Julia Fractal", Mono.Unix.Catalog.GetString ("Julia Fractal..."), null, "Menu.Effects.Render.JuliaFractal.png");
            MandelbrotFractal = new Gtk.Action ("Mandelbrot Fractal", Mono.Unix.Catalog.GetString ("Mandelbrot Factal..."), null, "Menu.Effects.Render.MandelbrotFractal.png");
            EdgeDetect = new Gtk.Action ("EdgeDetect", Mono.Unix.Catalog.GetString ("Edge Detect..."), null, "Menu.Effects.Stylize.EdgeDetect.png");
            AddNoise = new Gtk.Action ("AddNoise", Mono.Unix.Catalog.GetString ("Add Noise..."), null, "Menu.Effects.Noise.AddNoise.png");
            Median = new Gtk.Action ("Median", Mono.Unix.Catalog.GetString ("Median..."), null, "Menu.Effects.Noise.Median.png");
            Relief = new Gtk.Action ("Relief", Mono.Unix.Catalog.GetString ("Relief..."), null, "Menu.Effects.Stylize.Relief.png");
            Emboss = new Gtk.Action ("Emboss", Mono.Unix.Catalog.GetString ("Emboss..."), null, "Menu.Effects.Stylize.Emboss.png");
            ReduceNoise = new Gtk.Action ("ReduceNoise", Mono.Unix.Catalog.GetString ("Reduce Noise..."), null, "Menu.Effects.Noise.ReduceNoise.png");
            Outline = new Gtk.Action ("Outline", Mono.Unix.Catalog.GetString ("Outline..."), null, "Menu.Effects.Stylize.Outline.png");
        }
Пример #50
0
        private void CreateDockAndPads(HBox container)
        {
            Gtk.IconFactory fact = new Gtk.IconFactory();
            fact.Add("Tools.Pencil.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Tools.Pencil.png")));
            fact.Add("Pinta.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Pinta.png")));
            fact.AddDefault();

            // Dock widget
            dock = new DockFrame();
            dock.CompactGuiLevel = 5;

            var style = new DockVisualStyle();

            style.PadTitleLabelColor         = Styles.PadLabelColor;
            style.PadBackgroundColor         = Styles.PadBackground;
            style.InactivePadBackgroundColor = Styles.InactivePadBackground;
            style.TabStyle          = DockTabStyle.Normal;
            style.ShowPadTitleIcon  = false;
            dock.DefaultVisualStyle = style;

            // Toolbox pad
            var toolboxpad = new ToolBoxPad();

            toolboxpad.Initialize(dock, show_pad);

            // Palette pad
            var palettepad = new ColorPalettePad();

            palettepad.Initialize(dock, show_pad);

            // Canvas pad
            canvas_pad = new CanvasPad();
            canvas_pad.Initialize(dock, show_pad);

            dock_container = canvas_pad.NotebookContainer;

            // Layer pad
            var layers_pad = new LayersPad();

            layers_pad.Initialize(dock, show_pad);

            // Open Images pad
            var open_images_pad = new OpenImagesPad();

            open_images_pad.Initialize(dock, show_pad);

            // History pad
            var history_pad = new HistoryPad();

            history_pad.Initialize(dock, show_pad);

            container.PackStart(dock, true, true, 0);

            string layout_file = PintaCore.Settings.LayoutFilePath;

            if (System.IO.File.Exists(layout_file))
            {
                try
                {
                    dock.LoadLayouts(layout_file);
                }
                // If parsing layouts.xml fails for some reason, proceed to create the default layout.
                catch (Exception e)
                {
                    System.Console.Error.WriteLine("Error reading " + PintaCore.Settings.LayoutFile + ": " + e.ToString());
                }
            }

            if (!dock.HasLayout("Default"))
            {
                dock.CreateLayout("Default", false);
            }

            dock.CurrentLayout = "Default";
        }