Exemple #1
0
 public SelectLayerByNameEvent(ActionEvent srcEvent, string name) :
     base(srcEvent)
 {
     _name        = name;
     _modifier    = Parameters["selectionModifier"] as EnumParameter;
     _makeVisible = Parameters["MkVs"] as BoolParameter;
 }
 public SelectLayerByNameEvent(ActionEvent srcEvent, string name)
     : base(srcEvent)
 {
     _name = name;
       _modifier = Parameters["selectionModifier"] as EnumParameter;
       _makeVisible = Parameters["MkVs"] as BoolParameter;
 }
Exemple #3
0
        override public bool Execute()
        {
            double newWidth  = ActiveDrawable.Width;
            double newHeight = ActiveDrawable.Height;
            double oldWidth  = newWidth;
            double oldHeight = newHeight;

            Offset oldOffset = SelectedLayer.Offsets;

            var width = Parameters["Wdth"] as DoubleParameter;

            if (width != null)
            {
                newWidth = width.GetPixels(SelectedLayer.Width);
            }

            var height = Parameters["Hght"] as DoubleParameter;

            if (height != null)
            {
                newHeight = width.GetPixels(SelectedLayer.Height);
            }

            if (_needScaling)
            {
                SelectedLayer.Scale((int)newWidth, (int)newHeight, true);

                EnumParameter side = Parameters["FTcs"] as EnumParameter;

                switch (side.Value)
                {
                case "Qcs7":
                    SelectedLayer.Offsets = oldOffset;
                    break;

                case "Qcs5":
                    SelectedLayer.Offsets =
                        new Offset(oldOffset.X + (int)(oldWidth - newWidth),
                                   oldOffset.Y + (int)(oldHeight - newHeight));
                    break;

                case "Qcsa":
                    Console.WriteLine("TransformLayerEvent: Qcsa not supported yet");
                    break;

                default:
                    Console.WriteLine("FTcs: " + side.Value);
                    break;
                }
            }

            Offset();
            Translate();
            Skew();
            Rotate();

            return(true);
        }
Exemple #4
0
        protected override IEnumerable ListParameters()
        {
            yield return("From: Current History State");

            EnumParameter usng = Parameters["Usng"] as EnumParameter;

            if (usng != null)
            {
                yield return("Using: " + Abbreviations.Get(usng.Value));
            }
        }
Exemple #5
0
 protected string Format(EnumParameter parameter, string s)
 {
     if (parameter == null)
     {
         return(Abbreviations.Get(s) + ": fixme!");
     }
     else
     {
         return(Abbreviations.Get(s) + ": " +
                Abbreviations.Get(parameter.Value));
     }
 }
Exemple #6
0
        public Parameter ReadItem()
        {
            string key;
              if (PreSix)
            {
              key = ReadFourByteString();
            }
              else
            {
              key = ReadTokenOrString();
            }

              string type = ReadFourByteString();
              DebugOutput.Dump("key: {0} ({1})", key, type);

              Parameter parameter = null;

              switch (type)
            {
            case "alis":
              parameter = new AliasParameter();
              break;
            case "UntF":
              parameter = new DoubleParameter(true);
              break;
            case "bool":
              parameter = new BoolParameter();
              break;
            case "doub":
              parameter = new DoubleParameter(false);
              break;
            case "enum":
              parameter = new EnumParameter();
              break;
            case "obj":
              parameter = new ReferenceParameter();
              break;
            case "VlLs":
              parameter = new ListParameter();
              break;
            case "long":
              parameter = new LongParameter();
              break;
            case "Pth":
              parameter = new PathParameter();
              break;
            case "TEXT":
              parameter = new TextParameter();
              break;
            case "ObAr":
              parameter = new ObArParameter();
              break;
            case "Objc":
              parameter = new ObjcParameter();
              break;
            case "tdta":
              parameter = new RawDataParameter();
              break;
            case "type":
              parameter = new TypeParameter();
              break;
            default:
              Console.WriteLine("ReadItem: type {0} unknown!", type);
              throw new GimpSharpException();
            }

              DebugOutput.Level++;
              parameter.Parse(this);
              DebugOutput.Level--;
              parameter.Name = key;

              return parameter;
        }
Exemple #7
0
        public Parameter ReadItem()
        {
            string key;

            if (PreSix)
            {
                key = ReadFourByteString();
            }
            else
            {
                key = ReadTokenOrString();
            }

            string type = ReadFourByteString();

            DebugOutput.Dump($"key: {key} ({type})");

            Parameter parameter = null;

            switch (type)
            {
            case "alis":
                parameter = new AliasParameter();
                break;

            case "UntF":
                parameter = new DoubleParameter(true);
                break;

            case "bool":
                parameter = new BoolParameter();
                break;

            case "doub":
                parameter = new DoubleParameter(false);
                break;

            case "enum":
                parameter = new EnumParameter();
                break;

            case "obj":
                parameter = new ReferenceParameter();
                break;

            case "VlLs":
                parameter = new ListParameter();
                break;

            case "long":
                parameter = new LongParameter();
                break;

            case "Pth":
                parameter = new PathParameter();
                break;

            case "TEXT":
                parameter = new TextParameter();
                break;

            case "ObAr":
                parameter = new ObArParameter();
                break;

            case "Objc":
                parameter = new ObjcParameter();
                break;

            case "tdta":
                parameter = new RawDataParameter();
                break;

            case "type":
                parameter = new TypeParameter();
                break;

            default:
                Console.WriteLine("ReadItem: type {0} unknown!", type);
                throw new GimpSharpException();
            }

            DebugOutput.Level++;
            parameter.Parse(this);
            DebugOutput.Level--;
            parameter.Name = key;

            return(parameter);
        }
Exemple #8
0
 protected string Format(EnumParameter parameter, string s)
 {
     if (parameter == null) {
     return Abbreviations.Get(s) + ": fixme!";
       } else {
     return Abbreviations.Get(s) + ": " +
       Abbreviations.Get(parameter.Value);
       }
 }