Exemplo n.º 1
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;
        }
Exemplo n.º 2
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;
        }
Exemplo n.º 3
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;
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
0
        static ImageService()
        {
            iconFactory.AddDefault();

            AddinManager.AddExtensionNodeHandler(IconsExtensionPath, delegate(object sender, ExtensionNodeEventArgs args) {
                StockIconCodon iconCodon = (StockIconCodon)args.ExtensionNode;
                switch (args.Change)
                {
                case ExtensionChange.Add:
                    if (!iconStock.ContainsKey(iconCodon.StockId))
                    {
                        iconStock[iconCodon.StockId] = new List <StockIconCodon> ();
                    }
                    iconStock[iconCodon.StockId].Add(iconCodon);
                    break;
                }
            });

            for (int i = 0; i < iconSizes.Length; i++)
            {
                int w, h;
                if (!Gtk.Icon.SizeLookup((Gtk.IconSize)i, out w, out h))
                {
                    w = h = -1;
                }
                iconSizes[i].Width  = w;
                iconSizes[i].Height = h;
            }
            if (Platform.IsWindows)
            {
                iconSizes[(int)Gtk.IconSize.Menu].Width  = 16;
                iconSizes[(int)Gtk.IconSize.Menu].Height = 16;
            }
        }
Exemplo n.º 6
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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 8
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;
        }
Exemplo n.º 9
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);
 }
Exemplo n.º 10
0
    static EditorStock()
    {
        // Load Window icon.
        WindowIcon = Gdk.Pixbuf.LoadFromResource("tuxjunior-editor.png");

        AddIcon(Eye, Gtk.IconSize.Menu, "stock-eye-12.png");
        AddIcon(EyeHalf, Gtk.IconSize.Menu, "stock-eye-half-12.png");

        // HACK: This is needed to make tool icons show up on Windows, no idea why.
        // TODO: test if this is still needed with additional SizeWildcarded.
        // SizeWildcarded only gives fuzzy images, at least for stock-eye-12.png
        // It looks like windows are confusing large and small toolbar size ("SmallToolbar" causes 2x bigger buttons that "LargeToolbar"), bug in GTK for windows? bug in windows themselves?
#if WINDOWS
        Gtk.IconSize ToolBarIconSize = Gtk.IconSize.SmallToolbar;
#else
        Gtk.IconSize ToolBarIconSize = Gtk.IconSize.LargeToolbar;
#endif
        AddIcon(ToolSelect, ToolBarIconSize, "stock-tool-select-24.png");
        AddIcon(ToolTiles, ToolBarIconSize, "stock-tool-tiles-24.png");
        AddIcon(ToolObjects, ToolBarIconSize, "stock-tool-objects-24.png");
        AddIcon(ToolBrush, ToolBarIconSize, "stock-tool-brush-24.png");
        AddIcon(ToolFill, ToolBarIconSize, "stock-tool-fill-24.png");
        AddIcon(ToolReplace, ToolBarIconSize, "stock-tool-replace-24.png");
        AddIcon(ToolPath, ToolBarIconSize, "stock-tool-path-24.png");

        stock.AddDefault();
    }
Exemplo n.º 11
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;
        }
Exemplo n.º 12
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;
        }
Exemplo n.º 13
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;
        }
Exemplo n.º 14
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"));
        }
Exemplo n.º 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%", "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;
        }
Exemplo n.º 16
0
        static GdlStock()
        {
            AddIcon("gdl-close", "stock-close-12.png");
            AddIcon("gdl-menu-left", "stock-menu-left-12.png");
            AddIcon("gdl-menu-right", "stock-menu-right-12.png");

            stock.AddDefault();
        }
Exemplo n.º 17
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();
 }
Exemplo n.º 18
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 ();
 }
Exemplo n.º 19
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();
 }
Exemplo n.º 20
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 ();
 }
Exemplo n.º 21
0
		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));
		}
Exemplo n.º 22
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);
        }
Exemplo n.º 23
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);
        }
Exemplo n.º 24
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();
        }
Exemplo n.º 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);
        }
Exemplo n.º 26
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";
        }
        static ImageService()
        {
            iconFactory.AddDefault();
            IconId.IconNameRequestHandler = delegate(string stockId) {
                EnsureStockIconIsLoaded(stockId);
            };

            AddinManager.AddExtensionNodeHandler(IconsExtensionPath, delegate(object sender, ExtensionNodeEventArgs args) {
                StockIconCodon iconCodon = (StockIconCodon)args.ExtensionNode;
                switch (args.Change)
                {
                case ExtensionChange.Add:
                    if (!iconStock.ContainsKey(iconCodon.StockId))
                    {
                        iconStock[iconCodon.StockId] = new List <StockIconCodon> ();
                    }
                    iconStock[iconCodon.StockId].Add(iconCodon);
                    break;
                }
            });

            for (int i = 0; i < iconSizes.Length; i++)
            {
                int w, h;
                if (!Gtk.Icon.SizeLookup((Gtk.IconSize)i, out w, out h))
                {
                    w = h = -1;
                }
                iconSizes[i].Width  = w;
                iconSizes[i].Height = h;
            }
            if (Platform.IsWindows)
            {
                iconSizes[(int)Gtk.IconSize.Menu].Width  = 16;
                iconSizes[(int)Gtk.IconSize.Menu].Height = 16;
            }

            // Preload icons defined in MD.Ide. Ensures that the gtk icon overrides are available.
            var current = AddinManager.CurrentAddin;

            foreach (var id in AddinManager.GetExtensionNodes(IconsExtensionPath).OfType <StockIconCodon> ().Where(c => c.Addin == current).Select(c => c.StockId).Distinct())
            {
                EnsureStockIconIsLoaded(id);
            }
        }
Exemplo n.º 28
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"));
            }
        }
Exemplo n.º 29
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 ("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");

            AddinManager = new Gtk.Action ("AddinManager", Catalog.GetString ("Add-in Manager"), null, "Menu.Edit.Addins.png");

            Undo.IsImportant = true;
            Undo.Sensitive = false;
            Redo.Sensitive = false;
            InvertSelection.Sensitive = false;
            Deselect.Sensitive = false;
            EraseSelection.Sensitive = false;
            FillSelection.Sensitive = false;
        }
Exemplo n.º 30
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("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");

            AddinManager = new Gtk.Action("AddinManager", Catalog.GetString("Add-in Manager"), null, "Menu.Edit.Addins.png");

            Undo.IsImportant          = true;
            Undo.Sensitive            = false;
            Redo.Sensitive            = false;
            InvertSelection.Sensitive = false;
            Deselect.Sensitive        = false;
            EraseSelection.Sensitive  = false;
            FillSelection.Sensitive   = false;
        }
Exemplo n.º 31
0
        static void gtml_activate()
        {
            icons = new Gtk.IconFactory();
            icons.AddDefault();

            window              = new Gtk.Window(PN);
            window.DeleteEvent += new DeleteEventHandler(Window_Delete);
            window.SetDefaultSize(800, 120);
            window.Decorated = true;

            grid = new Gtk.Grid();
            grid.ColumnHomogeneous = true;

            Gtk.Image icon = new Gtk.Image();
            icon.IconName          = ("list-add-symbolic");
            import_button          = new Gtk.Button(icon);
            import_button.Clicked += new EventHandler(gtml_import_full);
            Gtk.Box naw = new Gtk.Box(Gtk.Orientation.Horizontal, 1);
            naw.PackStart(import_button, true, true, 1);
            naw.ShowAll();

            stack             = new Gtk.Notebook();
            stack.EnablePopup = true;
            stack.GroupName   = "Mozilla Programs";
            stack.Scrollable  = true;

            stack.SetActionWidget(naw, Gtk.PackType.End);

            stack.Hexpand = true;
            stack.Vexpand = true;

            grid.Attach(stack, 1, 1, 1, 1);
            gtml_reload();

            window.Add(grid);

            window.ShowAll();
        }
Exemplo n.º 32
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");
        }
Exemplo n.º 33
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);
		}
	}
Exemplo n.º 34
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;
        }
Exemplo n.º 35
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;
        }
Exemplo n.º 36
0
        public Browser()
            : base(WindowType.Toplevel)
        {
            Title = "Summa";
            IconName = "summa";

            action_group = new Gtk.ActionGroup("general");
            factory = new IconFactory();
            factory.AddDefault();

            DestroyEvent += CloseWindow;
            DeleteEvent += CloseWindow;

            SetUpActionGroup();

            uimanager = new UIManager();
            uimanager.InsertActionGroup(action_group, 0);
            AddAccelGroup(uimanager.AccelGroup);
            SetUpUimanager();

            table = new Table(5, 5, false);
            Add(table);

            menubar = uimanager.GetWidget("/MenuBar");
            table.Attach(menubar, 0, 5, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            toolbar = uimanager.GetWidget("/ToolBar");
            table.Attach(toolbar, 0, 5, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            main_paned = new HPaned();
            table.Attach(main_paned, 0, 5, 2, 3);

            left_paned = new VPaned();
            main_paned.Pack1(left_paned, true, true);

            TagView = new TagView();
            TagView.CursorChanged += new EventHandler(TagviewChanged);
            TagView_swin = new ScrolledWindow(new Adjustment(0, 0, 0, 0, 0, 0), new Adjustment(0, 0, 0, 0, 0, 0));
            TagView_swin.Add(TagView);
            TagView_swin.ShadowType = ShadowType.In;
            TagView_swin.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            left_paned.Pack1(TagView_swin, true, true);

            FeedView = new FeedView();
            FeedView.CursorChanged += new EventHandler(FeedviewChanged);
            FeedView_swin = new ScrolledWindow(new Adjustment(0, 0, 0, 0, 0, 0), new Adjustment(0, 0, 0, 0, 0, 0));
            FeedView_swin.Add(FeedView);
            FeedView_swin.ShadowType = ShadowType.In;
            FeedView_swin.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            left_paned.Pack2(FeedView_swin, true, true);

            if ( Config.WidescreenView ) {
                right_paned = new HPaned();
            } else {
                right_paned = new VPaned();
            }
            main_paned.Pack2(right_paned, true, true);

            ItemView = new ItemView();
            ItemView.CursorChanged += new EventHandler(ItemviewChanged);
            ItemView_swin = new ScrolledWindow(new Adjustment(0, 0, 0, 0, 0, 0), new Adjustment(0, 0, 0, 0, 0, 0));
            ItemView_swin.Add(ItemView);
            ItemView_swin.ShadowType = ShadowType.In;
            ItemView_swin.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            right_paned.Pack1(ItemView_swin, true, true);

            ItemNotebook = new ItemNotebook();
            right_paned.Pack2(ItemNotebook, true, true);

            StatusBar = new NotificationBar();
            table.Attach(StatusBar, 0, 5, 3, 4, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            UpdateFromConfig();
            FeedView.Populate("All");

            Database.ItemChanged += OnItemChanged;
            Database.ItemAdded += OnItemAdded;
            Notifier.ViewChanged += OnViewChanged;
        }
Exemplo n.º 37
0
        void BuildToolBar()
        {
            IconFactory icon_factory = new IconFactory ();
            AddIcon (icon_factory, "logic-games", "logic-games-32.png");
            AddIcon (icon_factory, "math-games", "math-games-32.png");
            AddIcon (icon_factory, "memory-games", "memory-games-32.png");
            AddIcon (icon_factory, "verbal-games", "verbal-games-32.png");
            AddIcon (icon_factory, "pause", "pause-32.png");
            AddIcon (icon_factory, "resume", "resume-32.png");
            AddIcon (icon_factory, "endgame", "endgame-32.png");
            AddIcon (icon_factory, "allgames", "allgames-32.png");
            icon_factory.AddDefault ();

            IconSize = Gtk.IconSize.Dnd;

            AllButton = new ToolButton ("allgames");
            AllButton.TooltipText = Catalog.GetString ("Play all the games");
            AllButton.Label = Catalog.GetString ("All");
            Insert (AllButton, -1);

            LogicButton = new ToolButton ("logic-games");
            LogicButton.TooltipText = Catalog.GetString ("Play games that challenge your reasoning and thinking");
            LogicButton.Label = Catalog.GetString ("Logic");
            Insert (LogicButton, -1);

            CalculationButton = new ToolButton ("math-games");
            CalculationButton.Label = Catalog.GetString ("Calculation");
            CalculationButton.TooltipText = Catalog.GetString ("Play games that challenge your mental calculation skills");
            Insert (CalculationButton, -1);

            MemoryButton = new ToolButton ("memory-games");
            MemoryButton.Label = Catalog.GetString ("Memory");
            MemoryButton.TooltipText = Catalog.GetString ("Play games that challenge your short term memory");
            Insert (MemoryButton, -1);

            VerbalButton = new ToolButton ("verbal-games");
            VerbalButton.Label = Catalog.GetString ("Verbal");
            VerbalButton.TooltipText = Catalog.GetString ("Play games that challenge your verbal aptitude");
            Insert (VerbalButton, -1);

            PauseButton = new ToolButton ("pause");
            PauseButton.Label = Catalog.GetString ("Pause");
            PauseButton.TooltipText = Catalog.GetString ("Pause or resume the game");
            Insert (PauseButton, -1);

            FinishButton = new ToolButton ("endgame");
            FinishButton.TooltipText = Catalog.GetString ("End the game and show score");
            FinishButton.Label = Catalog.GetString ("End");
            Insert (FinishButton, -1);
        }
Exemplo n.º 38
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;
		}
Exemplo n.º 39
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";
        }
Exemplo n.º 40
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";
        }
Exemplo n.º 41
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 ()); };
            }
        }
Exemplo n.º 42
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");
        }
Exemplo n.º 43
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);
 }
Exemplo n.º 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);

            // 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";
        }
Exemplo n.º 45
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);
 }
Exemplo n.º 46
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"));
            }
        }
Exemplo n.º 47
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";
        }
Exemplo n.º 48
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
        }
Exemplo n.º 49
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;
        }
Exemplo n.º 50
0
 void CreateStockIcons()
 {
     var factory = new IconFactory();
       factory.AddDefault();
       AddStockIcon(factory, "slice-tool-arrow", "stock-arrow.png");
 }
Exemplo n.º 51
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";
        }
Exemplo n.º 52
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";
        }