Exemplo n.º 1
0
        override public ActionEvent Parse(ActionParser parser)
        {
            ActionEvent myEvent = base.Parse(parser);

            ReferenceType parameter = _obj.Set[0];

            if (parameter is ClassType)
            {
                ClassType type = parameter as ClassType;
                switch (type.ClassID2)
                {
                case "Path":
                    return(new DeselectPathEvent(this));

                default:
                    Console.WriteLine("DeselectEvent.class: " + type.ClassID2);
                    break;
                }
            }
            else
            {
                Console.WriteLine("DeselectEvent: " + parameter);
            }

            return(myEvent);
        }
Exemplo n.º 2
0
        public override ActionEvent Parse(ActionParser parser)
        {
            ActionEvent myEvent = base.Parse(parser);

              ReferenceType parameter = _obj.Set[0];

              if (parameter is ClassType)
            {
              ClassType type = parameter as ClassType;
              switch (type.ClassID2)
            {
            case "Path":
              return new DeselectPathEvent(this);
            default:
              Console.WriteLine("DeselectEvent.class: " + type.ClassID2);
              break;
            }
            }
              else
            {
              Console.WriteLine("DeselectEvent: " + parameter);
            }

              return myEvent;
        }
Exemplo n.º 3
0
        public override ActionEvent Parse(ActionParser parser)
        {
            base.Parse(parser);

              if (_obj != null)
            {
              if (_obj.Set[0] is PropertyType)
            {
              PropertyType property = _obj.Set[0] as PropertyType;

              switch (property.ClassID2)
            {
            case "Prpr":
              switch (property.Key)
            {
            case "QucM":
              return new ClearQuickMaskEvent(this);
            default:
              Console.WriteLine("ClearEvent.Prpr: " + property.Key);
              break;
            }
              break;
            default:
              Console.WriteLine("ClearEvent.Parse: " + property.ClassID2);
              break;
            }
            }
              else
            {
              Console.WriteLine("ClearEvent.Parse: {0} unknown type",
                _obj.Set[0]);
            }
            }
              return this;
        }
Exemplo n.º 4
0
        public override void Parse(ActionParser parser)
        {
            int nr1 = parser.ReadInt32();

            string txt = parser.ReadFourByteString();

            if (txt == "txtu")
            {
                int nr2 = parser.ReadByte();

                int length = parser.ReadInt32();

                for (int i = 0; i < 2; i++)
                {
                    parser.ReadByte();
                }

                Path = parser.ReadUnicodeString(length);
                parser.ReadByte();
            }
            else
            {
                parser.ReadBytes(9);
                Path = parser.ReadString();
                parser.ReadBytes(255 - Path.Length);
            }
        }
Exemplo n.º 5
0
        public override void Parse(ActionParser parser)
        {
            int nr1 = parser.ReadInt32();

              string txt = parser.ReadFourByteString();

              if (txt == "txtu")
            {
              int nr2 = parser.ReadByte();

              int length = parser.ReadInt32();

              for (int i = 0; i < 2; i++)
            parser.ReadByte();

              Path = parser.ReadUnicodeString(length);
              parser.ReadByte();
            }
              else
            {
              parser.ReadBytes(9);
              Path = parser.ReadString();
              parser.ReadBytes(255 - Path.Length);
            }
        }
Exemplo n.º 6
0
        override public ActionEvent Parse(ActionParser parser)
        {
            base.Parse(parser);

            var obj = _list.Set[0] as ReferenceParameter;

            if (obj.Set[0] is EnmrType)
            {
                var enmr = obj.Set[0] as EnmrType;

                switch (enmr.Key)
                {
                case "Lyr":
                    return(new HideLayerEvent(this));

                case "Chnl":
                    return(new HideChannelEvent(this, enmr.Value));

                default:
                    Console.WriteLine("Can't hide " + enmr.Key);
                    break;
                }
            }
            else if (obj.Set[0] is NameType)
            {
                var name = obj.Set[0] as NameType;

                switch (name.ClassID2)
                {
                case "Chnl":
                    return(new HideChannelEvent(this, name.Key));

                case "Lyr":
                    return(new HideLayerEvent(this, name.Key));

                default:
                    Console.WriteLine("Can't hide " + name.ClassID2);
                    break;
                }
            }
            else if (obj.Set[0] is PropertyType)
            {
                var property = obj.Set[0] as PropertyType;
                switch (property.ClassID2)
                {
                case "Lyr":
                    return(new HideLayerEvent(this, property));

                default:
                    Console.WriteLine("Can't hide " + property.Key);
                    break;
                }
            }
            else
            {
                Console.WriteLine("HideEvent: " + obj.Set[0]);
            }
            return(this);
        }
Exemplo n.º 7
0
 public override void Parse(ActionParser parser)
 {
     if (_hasUnits)
     {
         Units = parser.ReadFourByteString();
     }
     Value = parser.ReadDouble();
 }
Exemplo n.º 8
0
        public virtual ActionEvent Parse(ActionParser parser)
        {
            // _parameters = new ParameterSet();
            DebugOutput.Level++;
            _parameters.Parse(parser, this, NumberOfItems);
            DebugOutput.Level--;

            return(this);
        }
Exemplo n.º 9
0
        public override void Parse(ActionParser parser)
        {
            if (!parser.PreSix)
            {
                ClassID = parser.ReadTokenOrUnicodeString();
            }
            ClassID2 = parser.ReadTokenOrString();
            Key      = parser.ReadTokenOrUnicodeString();

            DebugOutput.Dump("Name: c = {ClassID}, c2 = {ClassID2}, k = {Key}");
        }
Exemplo n.º 10
0
        public override ActionEvent Parse(ActionParser parser)
        {
            base.Parse(parser);

              ReferenceParameter obj = _list.Set[0] as ReferenceParameter;

              if (obj.Set[0] is EnmrType)
            {
              EnmrType enmr = obj.Set[0] as EnmrType;

              switch (enmr.Key)
            {
            case "Lyr":
              return new HideLayerEvent(this);
            case "Chnl":
              return new HideChannelEvent(this, enmr.Value);
            default:
              Console.WriteLine("Can't hide " + enmr.Key);
              break;
            }
            }
              else if (obj.Set[0] is NameType)
            {
              NameType name = obj.Set[0] as NameType;

              switch (name.ClassID2)
            {
            case "Chnl":
              return new HideChannelEvent(this, name.Key);
            case "Lyr":
              return new HideLayerEvent(this, name.Key);
            default:
              Console.WriteLine("Can't hide " + name.ClassID2);
              break;
            }
            }
              else if (obj.Set[0] is PropertyType)
            {
              PropertyType property = obj.Set[0] as PropertyType;
              switch (property.ClassID2)
            {
            case "Lyr":
              return new HideLayerEvent(this, property);
            default:
              Console.WriteLine("Can't hide " + property.Key);
              break;
            }
            }
              else
            {
              Console.WriteLine("HideEvent: " + obj.Set[0]);
            }
              return this;
        }
Exemplo n.º 11
0
 public override void Parse(ActionParser parser)
 {
     if (parser.PreSix)
     {
         Value = parser.ReadFourByteString();
     }
     else
     {
         Type  = parser.ReadUnicodeString();
         Value = parser.ReadTokenOrString();
     }
 }
Exemplo n.º 12
0
 public void Parse(ActionParser parser, int numberOfItems)
 {
     for (int i = 0; i < numberOfItems; i++)
     {
         var parameter = parser.ReadItem();
         if (parameter != null)
         {
             _set[parameter.Name] = parameter;
             _list.Add(parameter);
         }
     }
 }
Exemplo n.º 13
0
        public override void Parse(ActionParser parser)
        {
            if (!parser.PreSix)
            {
              ClassID = parser.ReadTokenOrUnicodeString();
            }
              ClassID2 = parser.ReadTokenOrString();
              Key = parser.ReadTokenOrUnicodeString();

              DebugOutput.Dump("Name: c = {0}, c2 = {1}, k = {2}", ClassID,
               ClassID2, Key);
        }
Exemplo n.º 14
0
        public override void Parse(ActionParser parser)
        {
            if (!parser.PreSix)
            {
                ClassID = parser.ReadTokenOrUnicodeString();
            }
            Key   = parser.ReadTokenOrString();
            Type  = parser.ReadTokenOrString();
            Value = parser.ReadTokenOrString();

            DebugOutput.Dump($"Enmr: c = {ClassID}, k = {Key}, t = {Type}, v = {Value}");
        }
Exemplo n.º 15
0
 public override void Parse(ActionParser parser)
 {
     if (parser.PreSix)
     {
       Value = parser.ReadFourByteString();
     }
       else
     {
       Type = parser.ReadUnicodeString();
       Value = parser.ReadTokenOrString();
     }
 }
Exemplo n.º 16
0
        public override void Parse(ActionParser parser)
        {
            if (!parser.PreSix)
            {
              ClassID = parser.ReadTokenOrUnicodeString();
            }
              Key = parser.ReadTokenOrString();
              Type = parser.ReadTokenOrString();
              Value = parser.ReadTokenOrString();

              DebugOutput.Dump("Enmr: c = {0}, k = {1}, t = {2}, v = {3}",
               ClassID, Key, Type, Value);
        }
Exemplo n.º 17
0
        public override void Parse(ActionParser parser)
        {
            if (!parser.PreSix)
            {
                ClassID = parser.ReadTokenOrUnicodeString();
            }
            Key   = parser.ReadTokenOrString();
            Type  = parser.ReadTokenOrString();
            Value = parser.ReadTokenOrString();

            DebugOutput.Dump("Enmr: c = {0}, k = {1}, t = {2}, v = {3}",
                             ClassID, Key, Type, Value);
        }
Exemplo n.º 18
0
        public override void Parse(ActionParser parser)
        {
            int number = parser.ReadInt32();

            for (int i = 0; i < number; i++)
            {
                ReferenceType referenceType = null;

                string type = parser.ReadFourByteString();

                switch (type)
                {
                case "Clss":
                    referenceType = new ClassType();
                    break;

                case "Enmr":
                    referenceType = new EnmrType();
                    break;

                case "indx":
                    referenceType = new IndexType();
                    break;

                case "name":
                    referenceType = new NameType();
                    break;

                case "prop":
                    referenceType = new PropertyType();
                    break;

                case "rele":
                    referenceType = new ReleType();
                    break;

                default:
                    Console.WriteLine("ReferenceParameter: type {0} unknown!",
                                      type);
                    break;
                }

                if (referenceType != null)
                {
                    referenceType.Parse(parser);
                    Set.Add(referenceType);
                }
            }
        }
Exemplo n.º 19
0
        override public ActionEvent Parse(ActionParser parser)
        {
            base.Parse(parser);

            if (_obj != null)
            {
                if (_obj.Set[0] is EnmrType)
                {
                    EnmrType enmr = _obj.Set[0] as EnmrType;
                    switch (enmr.Key)
                    {
                    case "Lyr":
                        return(new TransformLayerEvent(this));

                    default:
                        Console.WriteLine("Transform-2: unknown key " + enmr.Key);
                        break;
                    }
                }
                else if (_obj.Set[0] is PropertyType)
                {
                    PropertyType property = _obj.Set[0] as PropertyType;
                    switch (property.Key)
                    {
                    case "fsel":
                        return(new TransformSelectionEvent(this));

                    default:
                        Console.WriteLine("Transform-4: unknown key " +
                                          property.Key);
                        break;
                    }
                }
                else
                {
                    Console.WriteLine("Transform-3: " + _obj.Set[0]);
                }
            }
            else
            {
                Console.WriteLine("Transform-1");
            }

            return(this);
        }
Exemplo n.º 20
0
        TreeStore CreateActionTree()
        {
            var store = new TreeStore(typeof(string), typeof(IExecutable));

            string scriptDir = Gimp.Directory +
                               System.IO.Path.DirectorySeparatorChar + "scripts";

            var parser = new ActionParser(_image, _drawable);

            int nrScripts = 0;

            DebugOutput.Quiet = false;

            foreach (string fileName in Directory.GetFiles(scriptDir))
            {
                if (fileName.EndsWith(".atn"))
                {
                    Console.WriteLine(fileName);
                    nrScripts++;

                    var actions = parser.Parse(fileName);

                    if (actions != null)
                    {
                        _set.Add(actions);

                        var iter = store.AppendValues(actions.ExtendedName, actions);
                        foreach (var action in actions)
                        {
                            var iter1 = store.AppendValues(iter, action.Name,
                                                           action);
                            foreach (var actionEvent in action)
                            {
                                Console.WriteLine(actionEvent.EventForDisplay);
                                actionEvent.FillStore(store, iter1);
                            }
                        }
                    }
                }
            }

            DumpStatistics(parser, nrScripts);

            return(store);
        }
Exemplo n.º 21
0
        void DumpStatistics(ActionParser parser, int nrScripts)
        {
            int nrExecutable        = 0;
            int nrActions           = 0;
            int nrEvents            = 0;
            int nrExecutableActions = 0;
            int nrExecutableEvents  = 0;

            foreach (var actions in _set)
            {
                if (actions.IsExecutable)
                {
                    nrExecutable++;
                }
                nrActions += actions.NrOfActions;
                nrEvents  += actions.ActionEvents;

                nrExecutableActions += actions.ExecutableActions;
                nrExecutableEvents  += actions.ExecutableActionEvents;
            }

            double percParsed = (nrScripts - parser.ParsingFailed) * 100.0 /
                                nrScripts;
            double percExecutable        = nrExecutable * 100.0 / nrScripts;
            double percExecutableActions = nrExecutableActions * 100.0 / nrActions;
            double percExecutableEvents  = nrExecutableEvents * 100.0 / nrEvents;

            Console.WriteLine("#Total scripts      : " + nrScripts);
            Console.WriteLine("#Total actions      : " + nrActions);
            Console.WriteLine("#Total events       : " + nrEvents);
            Console.WriteLine("#Parsed             : " + _set.Count);
            Console.WriteLine("#Old                : " + parser.OldVersions);
            Console.WriteLine("#Failed             : " + parser.ParsingFailed);
            Console.WriteLine("#Scripts executable : " + nrExecutable);
            Console.WriteLine("#Actions executable : " + nrExecutableActions);
            Console.WriteLine("#Events executable  : " + nrExecutableEvents);
            Console.WriteLine("% parsed            : " + percParsed);
            Console.WriteLine("% executable scripts: " + percExecutable);
            Console.WriteLine("% executable actions: " + percExecutableActions);
            Console.WriteLine("% executable events : " + percExecutableEvents);

            Console.WriteLine();
            parser.DumpStatistics();
        }
Exemplo n.º 22
0
        public override void Parse(ActionParser parser)
        {
            int number = parser.ReadInt32();

              for (int i = 0; i < number; i++)
            {
              ReferenceType referenceType = null;

              string type = parser.ReadFourByteString();

              switch (type)
            {
            case "Clss":
              referenceType = new ClassType();
              break;
            case "Enmr":
              referenceType = new EnmrType();
              break;
            case "indx":
              referenceType = new IndexType();
              break;
            case "name":
              referenceType = new NameType();
              break;
            case "prop":
              referenceType = new PropertyType();
              break;
            case "rele":
              referenceType = new ReleType();
              break;
            default:
              Console.WriteLine("ReferenceParameter: type {0} unknown!",
                type);
              break;
            }

              if (referenceType != null)
            {
              referenceType.Parse(parser);
              _set.Add(referenceType);
            }
            }
        }
Exemplo n.º 23
0
        public override ActionEvent Parse(ActionParser parser)
        {
            base.Parse(parser);

              if (_obj != null)
            {
              if (_obj.Set[0] is EnmrType)
            {
              EnmrType enmr = _obj.Set[0] as EnmrType;
              switch (enmr.Key)
            {
            case "Lyr":
              return new TransformLayerEvent(this);
            default:
              Console.WriteLine("Transform-2: unknown key " + enmr.Key);
              break;
            }
            }
              else if (_obj.Set[0] is PropertyType)
            {
              PropertyType property = _obj.Set[0] as PropertyType;
              switch (property.Key)
            {
            case "fsel":
              return new TransformSelectionEvent(this);
            default:
              Console.WriteLine("Transform-4: unknown key " +
                    property.Key);
              break;
            }
            }
              else
            {
              Console.WriteLine("Transform-3: " + _obj.Set[0]);
            }
            }
              else
            {
              Console.WriteLine("Transform-1");
            }

              return this;
        }
Exemplo n.º 24
0
        public override void Parse(ActionParser parser)
        {
            int number = parser.ReadInt32();

            DebugOutput.Dump("number: " + number);

            for (int i = 0; i < number; i++)
            {
                string type = parser.ReadFourByteString();
                DebugOutput.Dump("type: " + type);

                Parameter parameter = null;

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

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

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

                default:
                    Console.WriteLine("ReadVlLs: type {0} unknown!", type);
                    return;
                }

                if (parameter != null)
                {
                    DebugOutput.Level++;
                    parameter.Parse(parser);
                    DebugOutput.Level--;
                    Set.Add(parameter);
                }
            }
        }
Exemplo n.º 25
0
        override public ActionEvent Parse(ActionParser parser)
        {
            base.Parse(parser);

            if (_adjustment == null)
            {
                Console.WriteLine("HueSaturationEvent: implement colorization only");
            }
            else if (_adjustment.Count > 1)
            {
                Console.WriteLine("HueSaturationEvent: implement for > 1 params");
            }
            else if (_adjustment[0] is ObjcParameter)
            {
                ObjcParameter objc = _adjustment[0] as ObjcParameter;

                _hue        = (int)objc.GetValueAsLong("H");
                _saturation = (int)objc.GetValueAsLong("Strt");
                _lightness  = (int)objc.GetValueAsLong("Lght");
            }
            return(this);
        }
Exemplo n.º 26
0
        public override ActionEvent Parse(ActionParser parser)
        {
            base.Parse(parser);

              if (_adjustment == null)
            {
              Console.WriteLine("HueSaturationEvent: implement colorization only");
            }
              else if (_adjustment.Count > 1)
            {
              Console.WriteLine("HueSaturationEvent: implement for > 1 params");
            }
              else if (_adjustment[0] is ObjcParameter)
            {
              ObjcParameter objc = _adjustment[0] as ObjcParameter;

              _hue = (int) objc.GetValueAsLong("H");
              _saturation = (int) objc.GetValueAsLong("Strt");
              _lightness = (int) objc.GetValueAsLong("Lght");
            }
              return this;
        }
Exemplo n.º 27
0
        public override void Parse(ActionParser parser)
        {
            if (parser.PreSix)
            {
                _classID2 = parser.ReadFourByteString();
            }
            else
            {
                _classID = parser.ReadUnicodeString();
                DebugOutput.Dump("ClassID: " + _classID);
                _classID2 = parser.ReadTokenOrString();
            }

            DebugOutput.Dump("ClassID2: " + _classID2);

            int numberOfItems = parser.ReadInt32();

            DebugOutput.Dump("NumberOfItems: " + numberOfItems);

            DebugOutput.Level++;
            _children.Parse(parser, numberOfItems);
            DebugOutput.Level--;
        }
Exemplo n.º 28
0
        override public ActionEvent Parse(ActionParser parser)
        {
            ActionEvent myEvent = base.Parse(parser);

            if (_obj != null)
            {
                if (_obj.Set[0] is PropertyType)
                {
                    PropertyType property = _obj.Set[0] as PropertyType;

                    switch (property.ClassID2)
                    {
                    case "Path":
                        return(new StrokePathEvent(this));

                    default:
                        Console.WriteLine("StrokeEvent: " + property.ClassID2);
                        break;
                    }
                }
            }
            return(this);
        }
Exemplo n.º 29
0
        override public ActionEvent Parse(ActionParser parser)
        {
            base.Parse(parser);

            if (_obj != null)
            {
                if (_obj.Set[0] is PropertyType)
                {
                    PropertyType property = _obj.Set[0] as PropertyType;

                    switch (property.ClassID2)
                    {
                    case "Prpr":
                        switch (property.Key)
                        {
                        case "QucM":
                            return(new ClearQuickMaskEvent(this));

                        default:
                            Console.WriteLine("ClearEvent.Prpr: " + property.Key);
                            break;
                        }
                        break;

                    default:
                        Console.WriteLine("ClearEvent.Parse: " + property.ClassID2);
                        break;
                    }
                }
                else
                {
                    Console.WriteLine("ClearEvent.Parse: {0} unknown type",
                                      _obj.Set[0]);
                }
            }
            return(this);
        }
Exemplo n.º 30
0
        override public ActionEvent Parse(ActionParser parser)
        {
            if (_parameter is ObjcParameter)
            {
                ObjcParameter objc     = _parameter as ObjcParameter;
                string        classID2 = objc.ClassID2;

                switch (classID2)
                {
                case "Elps":
                    return(new SelectEllipseEvent(this, objc));

                case "Plgn":
                    return(new SelectPolygonEvent(this, objc));

                case "Pnt":
                    return(new SelectPointEvent(this, objc));

                case "Rctn":
                    return(new SelectRectangleEvent(this, objc));

                case "Sngc":
                    return(new SelectSingleRowEvent(this, objc));

                case "Sngr":
                    return(new SelectSingleRowEvent(this, objc));

                default:
                    Console.WriteLine("SelectionEvent Implement " + classID2);
                    break;
                }
            }
            else if (_parameter is EnumParameter)
            {
                string type = (_parameter as EnumParameter).Value;

                switch (type)
                {
                case "Al":
                    return(new SelectAllEvent(this));

                case "None":
                    return(new SelectNoneEvent(this));

                case "Prvs":
                    return(new SelectPreviousEvent(this));

                default:
                    Console.WriteLine("SelectionEvent-1: " + type);
                    break;
                }
            }
            else if (_parameter is ReferenceParameter)
            {
                ReferenceParameter enmr = _parameter as ReferenceParameter;

                if (enmr.Set[0] is EnmrType)
                {
                    EnmrType type = enmr.Set[0] as EnmrType;
                    switch (type.Key)
                    {
                    case "Chnl":
                        return(new SelectionFromChannelEvent(this, type.Value));

                    case "Pxel":
                        return(new SelectPixelEvent(this, type.Value));

                    default:
                        Console.WriteLine("SelectionEvent-3: " + type.Key);
                        break;
                    }
                }
                else if (enmr.Set[0] is IndexType)
                {
                    IndexType index = enmr.Set[0] as IndexType;
                    switch (index.Key)
                    {
                    case "Chnl":
                        return(new SelectionByIndexEvent(this, index.Index));

                    default:
                        Console.WriteLine("SelectionEvent-5: " + index.Key);
                        break;
                    }
                }
                else if (enmr.Set[0] is NameType)
                {
                    NameType name = enmr.Set[0] as NameType;
                    switch (name.ClassID2)
                    {
                    case "Chnl":
                        return(new SelectionFromChannelEvent(this, name.Key));

                    default:
                        Console.WriteLine("SelectionEvent-6: " + name.ClassID2);
                        break;
                    }
                }
                else
                {
                    Console.WriteLine("SelectionEvent-4: " + enmr.Set[0]);
                }
            }
            else
            {
                Console.WriteLine("SelectionEvent-2: " + _parameter);
            }
            return(this);
        }
Exemplo n.º 31
0
        void DumpStatistics(ActionParser parser, int nrScripts)
        {
            int nrExecutable = 0;
              int nrActions = 0;
              int nrEvents = 0;
              int nrExecutableActions = 0;
              int nrExecutableEvents = 0;

              foreach (var actions in _set)
            {
              if (actions.IsExecutable)
            {
              nrExecutable++;
            }
              nrActions += actions.NrOfActions;
              nrEvents += actions.ActionEvents;

              nrExecutableActions += actions.ExecutableActions;
              nrExecutableEvents += actions.ExecutableActionEvents;
            }

              double percParsed = (nrScripts - parser.ParsingFailed) * 100.0 /
            nrScripts;
              double percExecutable = nrExecutable * 100.0 / nrScripts;
              double percExecutableActions = nrExecutableActions * 100.0 / nrActions;
              double percExecutableEvents = nrExecutableEvents * 100.0 / nrEvents;

              Console.WriteLine("#Total scripts      : " + nrScripts);
              Console.WriteLine("#Total actions      : " + nrActions);
              Console.WriteLine("#Total events       : " + nrEvents);
              Console.WriteLine("#Parsed             : " + _set.Count);
              Console.WriteLine("#Old                : " + parser.OldVersions);
              Console.WriteLine("#Failed             : " + parser.ParsingFailed);
              Console.WriteLine("#Scripts executable : " + nrExecutable);
              Console.WriteLine("#Actions executable : " + nrExecutableActions);
              Console.WriteLine("#Events executable  : " + nrExecutableEvents);
              Console.WriteLine("% parsed            : " + percParsed);
              Console.WriteLine("% executable scripts: " + percExecutable);
              Console.WriteLine("% executable actions: " + percExecutableActions);
              Console.WriteLine("% executable events : " + percExecutableEvents);

              Console.WriteLine();
              parser.DumpStatistics();
        }
Exemplo n.º 32
0
        public virtual ActionEvent Parse(ActionParser parser)
        {
            // _parameters = new ParameterSet();
              DebugOutput.Level++;
              _parameters.Parse(parser, this, NumberOfItems);
              DebugOutput.Level--;

              return this;
        }
Exemplo n.º 33
0
        public override ActionEvent Parse(ActionParser parser)
        {
            ActionEvent myEvent = base.Parse(parser);

              if (_obj != null)
            {
              if (_obj.Set[0] is PropertyType)
            {
              PropertyType property = _obj.Set[0] as PropertyType;

              switch (property.ClassID2)
            {
            case "Path":
              return new StrokePathEvent(this);
            default:
              Console.WriteLine("StrokeEvent: " + property.ClassID2);
              break;
            }
            }
            }
              return this;
        }
Exemplo n.º 34
0
        public override ActionEvent Parse(ActionParser parser)
        {
            ActionEvent myEvent = base.Parse(parser);

              if (_obj != null)
            {
              if (_obj.Set[0] is EnmrType)
            {
              EnmrType type = _obj.Set[0] as EnmrType;

              switch (type.Key)
            {
            case "Chnl":
              return new DuplicateChannelEvent(this, type.Value);
            case "Dcmn":
              return new DuplicateDocumentEvent(this, type.Value);
            case "Lyr":
              return new DuplicateLayerEvent(this);
            default:
              Console.WriteLine("DuplicateEvent: {0} unknown", type.Key);
              break;
            }
            }
              else if (_obj.Set[0] is NameType)
            {
              NameType type = _obj.Set[0] as NameType;

              switch (type.ClassID2)
            {
            case "Chnl":
              return new DuplicateChannelByNameEvent(this, type.Key);
            case "Lyr":
              return new DuplicateLayerByNameEvent(this, type.Key);
            default:
              Console.WriteLine("DuplicateEvent-1: {0} unknown",
                    type.ClassID2);
              break;
            }
            }
              else if (_obj.Set[0] is PropertyType)
            {
              PropertyType type = _obj.Set[0] as PropertyType;

              switch (type.ClassID2)
            {
            case "Lyr":
              return new DuplicateLayerByNameEvent(this, type.Key);
              break;
            case "Chnl":
              if (type.Key == "fsel")
            {
              return new DuplicateSelectionEvent(this);
            }
              else
            {
              Console.WriteLine("Duplicate Channel!");
            }
              break;
            default:
              Console.WriteLine("DuplicateEvent: {0} unknown", type.Key);
              break;
            }
            }
              else
            {
              Console.WriteLine("DuplicateEvent-2: {0} unknown", _obj.Set[0]);
            }
            }
              return this;
        }
Exemplo n.º 35
0
        public override ActionEvent Parse(ActionParser parser)
        {
            if (_parameter is ObjcParameter)
            {
              ObjcParameter objc = _parameter as ObjcParameter;
              string classID2 = objc.ClassID2;

              switch (classID2)
            {
            case "Elps":
              return new SelectEllipseEvent(this, objc);
            case "Plgn":
              return new SelectPolygonEvent(this, objc);
            case "Pnt":
              return new SelectPointEvent(this, objc);
            case "Rctn":
              return new SelectRectangleEvent(this, objc);
            case "Sngc":
              return new SelectSingleRowEvent(this, objc);
            case "Sngr":
              return new SelectSingleRowEvent(this, objc);
            default:
              Console.WriteLine("SelectionEvent Implement " + classID2);
              break;
            }
            }
              else if (_parameter is EnumParameter)
            {
              string type = (_parameter as EnumParameter).Value;

              switch (type)
            {
            case "Al":
              return new SelectAllEvent(this);
            case "None":
              return new SelectNoneEvent(this);
            case "Prvs":
              return new SelectPreviousEvent(this);
            default:
              Console.WriteLine("SelectionEvent-1: " + type);
              break;
            }
            }
              else if (_parameter is ReferenceParameter)
            {
              ReferenceParameter enmr = _parameter as ReferenceParameter;

              if (enmr.Set[0] is EnmrType)
            {
              EnmrType type = enmr.Set[0] as EnmrType;
              switch (type.Key)
            {
            case "Chnl":
              return new SelectionFromChannelEvent(this, type.Value);
            case "Pxel":
              return new SelectPixelEvent(this, type.Value);
            default:
              Console.WriteLine("SelectionEvent-3: " + type.Key);
              break;
            }
            }
              else if (enmr.Set[0] is IndexType)
            {
              IndexType index = enmr.Set[0] as IndexType;
              switch (index.Key)
            {
            case "Chnl":
              return new SelectionByIndexEvent(this, index.Index);
            default:
              Console.WriteLine("SelectionEvent-5: " + index.Key);
              break;
            }
            }
              else if (enmr.Set[0] is NameType)
            {
              NameType name = enmr.Set[0] as NameType;
              switch (name.ClassID2)
            {
            case "Chnl":
              return new SelectionFromChannelEvent(this, name.Key);
            default:
              Console.WriteLine("SelectionEvent-6: " + name.ClassID2);
              break;
            }
            }
              else
            {
              Console.WriteLine("SelectionEvent-4: " + enmr.Set[0]);
            }
            }
              else
            {
              Console.WriteLine("SelectionEvent-2: " + _parameter);
            }
              return this;
        }
Exemplo n.º 36
0
 public void Parse(ActionParser parser, Object obj, int numberOfItems)
 {
     Parse(parser, numberOfItems);
       Fill(obj);
 }
Exemplo n.º 37
0
        public override void Parse(ActionParser parser)
        {
            int number = parser.ReadInt32();
              DebugOutput.Dump("number: " + number);

              for (int i = 0; i < number; i++)
            {
              string type = parser.ReadFourByteString();
              DebugOutput.Dump("type: " + type);

              Parameter parameter = null;

              switch (type)
            {
            case "Objc":
              parameter = new ObjcParameter();
              break;
            case "long":
              parameter = new LongParameter();
              break;
            case "obj":
              parameter = new ReferenceParameter();
              break;
            default:
              Console.WriteLine("ReadVlLs: type {0} unknown!", type);
              return;
            }

              if (parameter != null)
            {
              DebugOutput.Level++;
              parameter.Parse(parser);
              DebugOutput.Level--;
              _set.Add(parameter);
            }
            }
        }
Exemplo n.º 38
0
        public override void Parse(ActionParser parser)
        {
            int length = parser.ReadInt32();

            Data = parser.ReadBytes(length);
        }
Exemplo n.º 39
0
        TreeStore CreateActionTree()
        {
            var store = new TreeStore(typeof(string), typeof(IExecutable));

              string scriptDir = Gimp.Directory +
            System.IO.Path.DirectorySeparatorChar + "scripts";

              var parser = new ActionParser(_image, _drawable);

              int nrScripts = 0;

              DebugOutput.Quiet = false;

              foreach (string fileName in Directory.GetFiles(scriptDir))
            {
              if (fileName.EndsWith(".atn"))
            {
              Console.WriteLine(fileName);
              nrScripts++;

              var actions = parser.Parse(fileName);

              if (actions != null)
            {
              _set.Add(actions);

              var iter = store.AppendValues(actions.ExtendedName, actions);
              foreach (var action in actions)
            {
              var iter1 = store.AppendValues(iter, action.Name,
                              action);
              foreach (var actionEvent in action)
            {
              Console.WriteLine(actionEvent.EventForDisplay);
              actionEvent.FillStore(store, iter1);
            }
            }
            }
            }
            }

              DumpStatistics(parser, nrScripts);

              return store;
        }
Exemplo n.º 40
0
        override public ActionEvent Parse(ActionParser parser)
        {
            ActionEvent myEvent = base.Parse(parser);

            if (_type != null)
            {
                if (_type is ReferenceParameter)
                {
                    ReferenceParameter type = _type as ReferenceParameter;

                    if (type.Set[0] is EnmrType)
                    {
                        EnmrType enmr = type.Set[0] as EnmrType;

                        switch (enmr.Key)
                        {
                        case "Lyr":
                            return(new MoveLayerEvent(this, enmr.Value));

                        default:
                            Console.WriteLine("MoveEvent, unknown key: " + enmr.Key);
                            break;
                        }
                    }
                    else if (type.Set[0] is IndexType)
                    {
                        IndexType index = type.Set[0] as IndexType;
                        switch (index.Key)
                        {
                        case "Lyr":
                            return(new MoveLayerByIndexEvent(this, index.Index));

                        default:
                            Console.WriteLine("MoveEvent, unknown key: " +
                                              index.Key);
                            break;
                        }
                    }
                }
                else if (_type is ObjcParameter)
                {
                    ObjcParameter type = _type as ObjcParameter;

                    if (type.ClassID2 == "Ofst")
                    {
                        return(new MoveOffsetEvent(this, type));
                    }
                    else
                    {
                        Console.WriteLine("MoveEvent-1: " + type.ClassID2);
                    }
                }
                else
                {
                    Console.WriteLine("MoveEvent-2");
                }
            }
            else
            {
                Console.WriteLine("MoveEvent-3");
            }
            return(myEvent);
        }
Exemplo n.º 41
0
 public override void Parse(ActionParser parser)
 {
     Value = parser.ReadUnicodeString();
 }
Exemplo n.º 42
0
        public override ActionEvent Parse(ActionParser parser)
        {
            ActionEvent myEvent = base.Parse(parser);

              if (_type != null)
            {
              if (_type is ReferenceParameter)
            {
              ReferenceParameter type = _type as ReferenceParameter;

              if (type.Set[0] is EnmrType)
            {
              EnmrType enmr = type.Set[0] as EnmrType;

              switch (enmr.Key)
            {
            case "Lyr":
              return new MoveLayerEvent(this, enmr.Value);
            default:
              Console.WriteLine("MoveEvent, unknown key: " + enmr.Key);
              break;
            }
            }
              else if (type.Set[0] is IndexType)
            {
              IndexType index = type.Set[0] as IndexType;
              switch (index.Key)
            {
            case "Lyr":
              return new MoveLayerByIndexEvent(this, index.Index);
            default:
              Console.WriteLine("MoveEvent, unknown key: " +
                    index.Key);
              break;
            }
            }
            }
              else if (_type is ObjcParameter)
            {
              ObjcParameter type = _type as ObjcParameter;

              if (type.ClassID2 == "Ofst")
            {
              return new MoveOffsetEvent(this, type);
            }
              else
            {
              Console.WriteLine("MoveEvent-1: " + type.ClassID2);
            }
            }
              else
            {
              Console.WriteLine("MoveEvent-2");
            }
            }
              else
            {
              Console.WriteLine("MoveEvent-3");
            }
              return myEvent;
        }
Exemplo n.º 43
0
 public void Parse(ActionParser parser, int numberOfItems)
 {
     for (int i = 0; i < numberOfItems; i++)
     {
       var parameter = parser.ReadItem();
       if (parameter != null)
     {
       _set[parameter.Name] = parameter;
       _list.Add(parameter);
     }
     }
 }
Exemplo n.º 44
0
 public override void Parse(ActionParser parser)
 {
     Value = parser.ReadInt32();
 }
Exemplo n.º 45
0
        override public ActionEvent Parse(ActionParser parser)
        {
            ActionEvent myEvent = base.Parse(parser);

            if (_obj != null)
            {
                if (_obj.Set[0] is EnmrType)
                {
                    var type = _obj.Set[0] as EnmrType;

                    switch (type.Key)
                    {
                    case "Chnl":
                        return(new DuplicateChannelEvent(this, type.Value));

                    case "Dcmn":
                        return(new DuplicateDocumentEvent(this, type.Value));

                    case "Lyr":
                        return(new DuplicateLayerEvent(this));

                    default:
                        Console.WriteLine("DuplicateEvent: {0} unknown", type.Key);
                        break;
                    }
                }
                else if (_obj.Set[0] is NameType)
                {
                    var type = _obj.Set[0] as NameType;

                    switch (type.ClassID2)
                    {
                    case "Chnl":
                        return(new DuplicateChannelByNameEvent(this, type.Key));

                    case "Lyr":
                        return(new DuplicateLayerByNameEvent(this, type.Key));

                    default:
                        Console.WriteLine("DuplicateEvent-1: {0} unknown",
                                          type.ClassID2);
                        break;
                    }
                }
                else if (_obj.Set[0] is PropertyType)
                {
                    var type = _obj.Set[0] as PropertyType;

                    switch (type.ClassID2)
                    {
                    case "Lyr":
                        return(new DuplicateLayerByNameEvent(this, type.Key));

                        break;

                    case "Chnl":
                        if (type.Key == "fsel")
                        {
                            return(new DuplicateSelectionEvent(this));
                        }
                        else
                        {
                            Console.WriteLine("Duplicate Channel!");
                        }
                        break;

                    default:
                        Console.WriteLine("DuplicateEvent: {0} unknown", type.Key);
                        break;
                    }
                }
                else
                {
                    Console.WriteLine("DuplicateEvent-2: {0} unknown", _obj.Set[0]);
                }
            }
            return(this);
        }
Exemplo n.º 46
0
 public abstract void Parse(ActionParser parser);
Exemplo n.º 47
0
        override public ActionEvent Parse(ActionParser parser)
        {
            ActionEvent myEvent = base.Parse(parser);

            if (_obj != null)
            {
                if (_obj.Set[0] is PropertyType)
                {
                    PropertyType property = _obj.Set[0] as PropertyType;

                    switch (property.ClassID2)
                    {
                    case "Clr":
                        switch (property.Key)
                        {
                        case "BckC":
                            return(new SetBackgroundColorEvent(this));

                        case "ClrT":
                            return(new SetColorTableEvent(this));

                        case "FrgC":
                            return(new SetForegroundColorEvent(this));

                        default:
                            Console.WriteLine("SetEvent.Clr.Prpr: " + property.Key);
                            break;
                        }
                        break;

                    case "Chnl":
                        if (property.Key == "fsel")
                        {
                            return(new SelectionEvent(this).Parse(parser));
                        }
                        break;

                    case "Lyr":
                        return(new SetLayerPropertyEvent(this));

                    case "Prpr":
                        switch (property.Key)
                        {
                        case "FlIn":
                            return(new SetFileInfoEvent(this));

                        case "Grdn":
                            return(new SetGradientEvent(this));

                        case "Lefx":
                            return(new SetLayerEffectsEvent(this));

                        case "QucM":
                            return(new SetQuickMaskEvent(this));

                        default:
                            Console.WriteLine("SetEvent.Prpr: " + property.Key);
                            break;
                        }
                        break;

                    case "HstS":
                        return(new SetHistoryStateEvent(this));

                        break;

                    default:
                        Console.WriteLine("SetEvent.Parse: " + property.ClassID2);
                        break;
                    }
                }
                else if (_obj.Set[0] is EnmrType)
                {
                    EnmrType enmr = _obj.Set[0] as EnmrType;
                    switch (enmr.Key)
                    {
                    case "AdjL":
                        return(new SetAdjustmentLayerEvent(this));

                    case "Brsh":
                        return(new SetBrushEvent(this));

                    case "Chnl":
                        return(new SetChannelPropertyEvent(this));

                    case "contentLayer":
                        return(new SetContentLayerEvent(this));

                    case "Lyr":
                        return(new SetLayerPropertyEvent(this));

                    case "TxLr":
                        return(new SetTextLayerPropertyEvent(this));

                    default:
                        Console.WriteLine("SetEvent.Parse-1: unknown key " +
                                          enmr.Key);
                        break;
                    }
                }
                else if (_obj.Set[0] is IndexType)
                {
                    IndexType index = _obj.Set[0] as IndexType;
                    switch (index.Key)
                    {
                    case "Chnl":
                        return(new SetChannelToSelectionEvent(this, index.Index));

                    default:
                        Console.WriteLine("SetEvent.Parse-2: unknown key " +
                                          index.Key);
                        break;
                    }
                }
                else if (_obj.Set[0] is NameType)
                {
                    NameType name = _obj.Set[0] as NameType;
                    switch (name.ClassID2)
                    {
                    case "Chnl":
                        return(new SetChannelByNameToSelectionEvent(this, name.Key));

                    case "Lyr":
                        return(new SetLayerPropertyEvent(this, name.Key));

                    default:
                        Console.WriteLine("SetEvent.Parse-3: unknown class " +
                                          name.ClassID2);
                        break;
                    }
                }
                else
                {
                    Console.WriteLine("SetEvent.Parse: {0} unknown type",
                                      _obj.Set[0]);
                }
            }

            return(this);
        }
Exemplo n.º 48
0
 public override void Parse(ActionParser parser)
 {
     Value = parser.ReadInt32();
 }
Exemplo n.º 49
0
 public override void Parse(ActionParser parser)
 {
     Value = (parser.ReadByte() == 0) ? false : true;
 }
Exemplo n.º 50
0
 public override void Parse(ActionParser parser)
 {
     int length = parser.ReadInt32();
       Data = parser.ReadBytes(length);
 }
Exemplo n.º 51
0
 public override void Parse(ActionParser parser)
 {
     if (_hasUnits)
     {
       Units = parser.ReadFourByteString();
     }
       Value = parser.ReadDouble();
 }
Exemplo n.º 52
0
        override public ActionEvent Parse(ActionParser parser)
        {
            ActionEvent myEvent = base.Parse(parser);

            if (_obj != null)
            {
                if (_obj.Set[0] is EnmrType)
                {
                    EnmrType type = _obj.Set[0] as EnmrType;
                    switch (type.Key)
                    {
                    case "Chnl":
                        return(new DeleteChannelEvent(this));

                    case "Gd":
                        return(new DeleteGuideEvent(this, type.Value));

                    case "Lyr":
                        return(new DeleteLayerEvent(this));

                    default:
                        Console.WriteLine("DeleteEvent-1: {0} unknown", type.Key);
                        break;
                    }
                }
                else if (_obj.Set[0] is NameType)
                {
                    NameType type = _obj.Set[0] as NameType;
                    switch (type.ClassID2)
                    {
                    case "Chnl":
                        return(new DeleteChannelByNameEvent(this, type.Key));

                    case "Lyr":
                        return(new DeleteLayerEvent(this));

                    default:
                        Console.WriteLine("DeleteEvent-2: {0} unknown",
                                          type.ClassID2);
                        break;
                    }
                }
                else if (_obj.Set[0] is PropertyType)
                {
                    PropertyType type = _obj.Set[0] as PropertyType;
                    switch (type.ClassID2)
                    {
                    case "Lyr":
                        return(new DeleteLayerByNameEvent(this, type.Key));

                    default:
                        Console.WriteLine("DeleteEvent-3: {0} unknown",
                                          type.ClassID2);
                        break;
                    }
                }
                else if (_obj.Set[0] is IndexType)
                {
                    IndexType type = _obj.Set[0] as IndexType;
                    switch (type.Key)
                    {
                    case "Chnl":
                        return(new DeleteChannelByIndexEvent(this, type.Index));

                    default:
                        Console.WriteLine("DeleteEvent-4: {0} unknown", type.Key);
                        break;
                    }
                }
                else
                {
                    Console.WriteLine("DeleteEvent: " + _obj.Set[0]);
                }
            }
            return(myEvent);
        }
Exemplo n.º 53
0
        public override ActionEvent Parse(ActionParser parser)
        {
            ActionEvent myEvent = base.Parse(parser);

              if (_obj != null)
            {
              if (_obj.Set[0] is EnmrType)
            {
              EnmrType type = _obj.Set[0] as EnmrType;
              switch (type.Key)
            {
            case "Chnl":
              return new DeleteChannelEvent(this);
            case "Gd":
              return new DeleteGuideEvent(this, type.Value);
            case "Lyr":
              return new DeleteLayerEvent(this);
            default:
              Console.WriteLine("DeleteEvent-1: {0} unknown", type.Key);
              break;
            }
            }
              else if (_obj.Set[0] is NameType)
            {
              NameType type = _obj.Set[0] as NameType;
              switch (type.ClassID2)
            {
            case "Chnl":
              return new DeleteChannelByNameEvent(this, type.Key);
            case "Lyr":
              return new DeleteLayerEvent(this);
            default:
              Console.WriteLine("DeleteEvent-2: {0} unknown",
                    type.ClassID2);
              break;
            }
            }
              else if (_obj.Set[0] is PropertyType)
            {
              PropertyType type = _obj.Set[0] as PropertyType;
              switch (type.ClassID2)
            {
            case "Lyr":
              return new DeleteLayerByNameEvent(this, type.Key);
            default:
              Console.WriteLine("DeleteEvent-3: {0} unknown",
                    type.ClassID2);
              break;
            }
            }
              else if (_obj.Set[0] is IndexType)
            {
              IndexType type = _obj.Set[0] as IndexType;
              switch (type.Key)
            {
            case "Chnl":
              return new DeleteChannelByIndexEvent(this, type.Index);
            default:
              Console.WriteLine("DeleteEvent-4: {0} unknown", type.Key);
              break;
            }
            }
              else
            {
              Console.WriteLine("DeleteEvent: " + _obj.Set[0]);
            }
            }
              return myEvent;
        }
Exemplo n.º 54
0
        public override ActionEvent Parse(ActionParser parser)
        {
            ActionEvent myEvent = base.Parse(parser);

              if (_object != null && _object is ObjcParameter)
            {
              string classID = (_object as ObjcParameter).ClassID2;

              switch (classID)
            {
            case "AdjL":
              return new AddAdjustmentLayerEvent(this);
            case "Chnl":
              return new NewChannelEvent(this, _object as ObjcParameter);
            case "Dcmn":
              return new NewDocumentEvent(this, _object as ObjcParameter);
            case "Gd":
              return new AddGuideEvent(this, _object as ObjcParameter);
            case "Lyr":
              return new AddLayerEvent(this);
            default:
              Console.WriteLine("MakeEvent-2: {0} not implemented", classID);
              break;
            }
            }
              if (_object != null && _object is TypeParameter)
            {
              return new AddMaskEvent(this);
            }
              else if (_obj != null)
            {
              ClassType classType = _obj.Set[0] as ClassType;
              switch (classType.ClassID2)
            {
            case "Actn":
              return new MakeActionEvent(this);
            case "AdjL":
              return new AddAdjustmentLayerEvent(this);
            case "annotation":
              return new MakeAnnotationEvent(this);
            case "BckL":
              return new MakeBackgroundLayerEvent(this);
            case "contentLayer":
              return new MakeContentLayerEvent(this);
            case "layerSection":
              return new MakeGroupEvent(this);
            case "Lyr":
              return new AddLayerEvent(this);
            case "Path":
              return new MakePathEvent(this);
            case "Ptrn":
              return new MakePatternEvent(this);
            case "SnpS":
              return new MakeSnapshotEvent(this);
            case "Styl":
              return new MakeStyleEvent(this);
            case "TxLr":
              return new AddTextLayerEvent(this);
            case "TxLy":
              return new AddTextLayerEvent(this);
            default:
              Console.WriteLine("MakeEvent-1: {0} not implemented",
                classType.ClassID2);
              break;
            }
            }
              else
            {
              Console.WriteLine("MakeEvent: Disaster!");
            }

              return myEvent;
        }
Exemplo n.º 55
0
        public override ActionEvent Parse(ActionParser parser)
        {
            ActionEvent myEvent = base.Parse(parser);

              if (_obj != null)
            {
              if (_obj.Set[0] is PropertyType)
            {
              PropertyType property = _obj.Set[0] as PropertyType;

              switch (property.ClassID2)
            {
            case "Clr":
              switch (property.Key)
            {
            case "BckC":
              return new SetBackgroundColorEvent(this);
            case "ClrT":
              return new SetColorTableEvent(this);
            case "FrgC":
              return new SetForegroundColorEvent(this);
            default:
              Console.WriteLine("SetEvent.Clr.Prpr: " + property.Key);
              break;
            }
              break;
            case "Chnl":
              if (property.Key == "fsel")
            {
              return new SelectionEvent(this).Parse(parser);
            }
              break;
            case "Lyr":
              return new SetLayerPropertyEvent(this);
            case "Prpr":
              switch (property.Key)
            {
            case "FlIn":
              return new SetFileInfoEvent(this);
            case "Grdn":
              return new SetGradientEvent(this);
            case "Lefx":
              return new SetLayerEffectsEvent(this);
            case "QucM":
              return new SetQuickMaskEvent(this);
            default:
              Console.WriteLine("SetEvent.Prpr: " + property.Key);
              break;
            }
              break;
            case "HstS":
              return new SetHistoryStateEvent(this);
              break;
            default:
              Console.WriteLine("SetEvent.Parse: " + property.ClassID2);
              break;
            }
            }
              else if (_obj.Set[0] is EnmrType)
            {
              EnmrType enmr = _obj.Set[0] as EnmrType;
              switch (enmr.Key)
            {
            case "AdjL":
              return new SetAdjustmentLayerEvent(this);
            case "Brsh":
              return new SetBrushEvent(this);
            case "Chnl":
              return new SetChannelPropertyEvent(this);
            case "contentLayer":
              return new SetContentLayerEvent(this);
            case "Lyr":
              return new SetLayerPropertyEvent(this);
            case "TxLr":
              return new SetTextLayerPropertyEvent(this);
            default:
              Console.WriteLine("SetEvent.Parse-1: unknown key " +
                    enmr.Key);
              break;
            }
            }
              else if (_obj.Set[0] is IndexType)
            {
              IndexType index = _obj.Set[0] as IndexType;
              switch (index.Key)
            {
            case "Chnl":
              return new SetChannelToSelectionEvent(this, index.Index);
            default:
              Console.WriteLine("SetEvent.Parse-2: unknown key " +
                    index.Key);
              break;
            }
            }
              else if (_obj.Set[0] is NameType)
            {
              NameType name = _obj.Set[0] as NameType;
              switch (name.ClassID2)
            {
            case "Chnl":
              return new SetChannelByNameToSelectionEvent(this, name.Key);
            case "Lyr":
              return new SetLayerPropertyEvent(this, name.Key);
            default:
              Console.WriteLine("SetEvent.Parse-3: unknown class " +
                    name.ClassID2);
              break;
            }
            }
              else
            {
              Console.WriteLine("SetEvent.Parse: {0} unknown type",
                _obj.Set[0]);
            }
            }

              return this;
        }
Exemplo n.º 56
0
        public override void Parse(ActionParser parser)
        {
            if (parser.PreSix)
            {
              _classID2 = parser.ReadFourByteString();
            }
              else
            {
              _classID = parser.ReadUnicodeString();
              DebugOutput.Dump("ClassID: " + _classID);
              _classID2 = parser.ReadTokenOrString();
            }

              DebugOutput.Dump("ClassID2: " + _classID2);

              int numberOfItems = parser.ReadInt32();
              DebugOutput.Dump("NumberOfItems: " + numberOfItems);

              DebugOutput.Level++;
              _children.Parse(parser, numberOfItems);
              DebugOutput.Level--;
        }
Exemplo n.º 57
0
        public override void Parse(ActionParser parser)
        {
            if (parser.PreSix)
            {
                _classID2 = parser.ReadTokenOrString();
                DebugOutput.Dump("ClassID2: " + _classID2);

                int numberOfItems = parser.ReadInt32();
                DebugOutput.Dump("NumberOfItems: " + numberOfItems);
            }
            else
            {
                int numberOfItems = parser.ReadInt32();
                DebugOutput.Dump("NumberOfItems: " + numberOfItems);

                _classID = parser.ReadUnicodeString();
                DebugOutput.Dump("ClassID: " + _classID);

                _classID2 = parser.ReadTokenOrString();
                DebugOutput.Dump("ClassID2: " + _classID2);
            }

            int numberOfFields = parser.ReadInt32();

            DebugOutput.Dump("NumberOfFields: " + numberOfFields);

            for (int i = 0; i < numberOfFields; i++)
            {
                string key  = parser.ReadTokenOrString();
                string type = parser.ReadFourByteString();
                _units = parser.ReadFourByteString();

                DebugOutput.Dump("key: {0} ({1}) {2}", key, type, _units);

                int numberOfItems = parser.ReadInt32();
                DebugOutput.Dump("NumberOfItems2: " + numberOfItems);

                switch (type)
                {
                case "UnFl":
                    for (int j = 0; j < numberOfItems; j++)
                    {
                        double val = parser.ReadDouble();

                        Coordinate <double> c;
                        if (i == 0)
                        {
                            c = new Coordinate <double>();
                            _value.Add(c);
                            c.X = val;
                        }
                        else
                        {
                            _value[j].Y = val;
                        }
                    }
                    break;

                default:
                    Console.WriteLine("ObAr:Unknown type: " + type);
                    break;
                }
            }
        }
Exemplo n.º 58
0
 public abstract void Parse(ActionParser parser);
Exemplo n.º 59
0
        override public ActionEvent Parse(ActionParser parser)
        {
            ActionEvent myEvent = base.Parse(parser);

            if (_object != null && _object is ObjcParameter)
            {
                string classID = (_object as ObjcParameter).ClassID2;

                switch (classID)
                {
                case "AdjL":
                    return(new AddAdjustmentLayerEvent(this));

                case "Chnl":
                    return(new NewChannelEvent(this, _object as ObjcParameter));

                case "Dcmn":
                    return(new NewDocumentEvent(this, _object as ObjcParameter));

                case "Gd":
                    return(new AddGuideEvent(this, _object as ObjcParameter));

                case "Lyr":
                    return(new AddLayerEvent(this));

                default:
                    Console.WriteLine("MakeEvent-2: {0} not implemented", classID);
                    break;
                }
            }
            if (_object != null && _object is TypeParameter)
            {
                return(new AddMaskEvent(this));
            }
            else if (_obj != null)
            {
                ClassType classType = _obj.Set[0] as ClassType;
                switch (classType.ClassID2)
                {
                case "Actn":
                    return(new MakeActionEvent(this));

                case "AdjL":
                    return(new AddAdjustmentLayerEvent(this));

                case "annotation":
                    return(new MakeAnnotationEvent(this));

                case "BckL":
                    return(new MakeBackgroundLayerEvent(this));

                case "contentLayer":
                    return(new MakeContentLayerEvent(this));

                case "layerSection":
                    return(new MakeGroupEvent(this));

                case "Lyr":
                    return(new AddLayerEvent(this));

                case "Path":
                    return(new MakePathEvent(this));

                case "Ptrn":
                    return(new MakePatternEvent(this));

                case "SnpS":
                    return(new MakeSnapshotEvent(this));

                case "Styl":
                    return(new MakeStyleEvent(this));

                case "TxLr":
                    return(new AddTextLayerEvent(this));

                case "TxLy":
                    return(new AddTextLayerEvent(this));

                default:
                    Console.WriteLine("MakeEvent-1: {0} not implemented",
                                      classType.ClassID2);
                    break;
                }
            }
            else
            {
                Console.WriteLine("MakeEvent: Disaster!");
            }

            return(myEvent);
        }
Exemplo n.º 60
0
 public override void Parse(ActionParser parser)
 {
     Value = (parser.ReadByte() == 0) ? false : true;
 }