public UndoInfo(FrameLayerPair layerAddress, int drawingItemID, UndoAction undoAction, object oldValue, object newValue)
 {
     this.LayerAddress = layerAddress;
     this.DrawingItemID = drawingItemID;
     this.Action = undoAction;
     this.OldValue = oldValue;
     this.NewValue = newValue;
 }
        public TransitionEffectSettings(int transitionID, FrameLayerPair layerAddress, TransitionEffectType efTypeFlag, Action<TransitionEffectSettings> wildCardHandler)
        {
            this.TransitionID = transitionID;
            this.LayerAddress = layerAddress;

            if (AnimationUtils.CountTransitionEffects (efTypeFlag) > 1 ||
                efTypeFlag == TransitionEffectType.None) {
                throw new ArgumentException ("Transition effect type argument should only contain 1 flag and should not be TransitionEffectType.None",
                                            "efTypeFlag");
            }//end if

            this.EffectType = efTypeFlag;
            this.WildcardHandler = wildCardHandler;

            this.Duration = 0.5d;
            this.RotationCount = 1;
            this.Delay = 0d;
        }
 public void SetLayerAddress(FrameLayerPair layerAddress)
 {
     this.LayerAddress = layerAddress;
 }
 public bool ContainsLayer(FrameLayerPair layerPair)
 {
     return this.ID == layerPair.FrameID &&
         this.Layers.ContainsKey (layerPair.LayerID);
 }
 public TransitionEffectMapping(TransitionEffectType efType, FrameLayerPair ownerLayer)
 {
     this.EffectType = efType;
     this.OwnerLayer = ownerLayer;
 }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.CreateAnimation);
            ImageView btns = FindViewById<ImageView>(Resource.Id.imgNewLoginHeader);
            TextView header = FindViewById<TextView>(Resource.Id.txtFirstScreenHeader);
            RelativeLayout relLayout = FindViewById<RelativeLayout>(Resource.Id.relativeLayout1);
            ImageHelper.setupTopPanel(btns, header, relLayout, header.Context);
            Header.headertext = Application.Context.Resources.GetString(Resource.String.animationTitle);
            Header.fontsize = 36f;
            ImageHelper.fontSizeInfo(header.Context);
            header.SetTextSize(Android.Util.ComplexUnitType.Dip, Header.fontsize);
            header.Text = Header.headertext;

            ImageButton btnBack = FindViewById<ImageButton>(Resource.Id.btnBack);
            ImageButton imgUndo = FindViewById<ImageButton>(Resource.Id.imgUndo);
            ImageButton imgStamp = FindViewById<ImageButton>(Resource.Id.imgStamp);
            ImageButton imgPaint = FindViewById<ImageButton>(Resource.Id.imgPaint);
            ImageButton imgColour = FindViewById<ImageButton>(Resource.Id.imgColour);
            ImageButton imgText = FindViewById<ImageButton>(Resource.Id.imgText);
            ImageButton imgComix = FindViewById<ImageButton>(Resource.Id.imgComix);
            ImageButton imgSound = FindViewById<ImageButton>(Resource.Id.imgSound);
            ImageButton imgPicture = FindViewById<ImageButton>(Resource.Id.imgPicture);
            ImageButton imgConfig = FindViewById<ImageButton>(Resource.Id.imgConfig);
            ImageButton imgPlayAnimation = FindViewById<ImageButton>(Resource.Id.imgPlayAnimation);
            ImageButton btnHome = FindViewById<ImageButton>(Resource.Id.btnHome);
            drawer = FindViewById<SlidingDrawer>(Resource.Id.slidingDrawer1);
            sliderToggle = FindViewById<Button>(Resource.Id.handle);
            context = header.Context;

            brushImage = null;

            relLay = FindViewById<RelativeLayout>(Resource.Id.relativeLayout2);
            relLay.LayoutParameters = new LinearLayout.LayoutParams((int)wowZapp.LaffOutOut.Singleton.ScreenXWidth,
                (int)wowZapp.LaffOutOut.Singleton.ScreenXWidth);

            if (AnimationUtil.imagesForCanvas == null)
                AnimationUtil.imagesForCanvas = new List<Bitmap>();

            if (currentColor == null)
            {

                currentColor = new WZColor(ImageHelper.convColToByteArray(Color.Black));
                inactiveColor = new WZColor(ImageHelper.convColToByteArray(Color.Gray));
                colorUtil.color = ImageHelper.convWZColorToColor(currentColor);
            }

            if (currentBrush == null)
            {
                using (Bitmap myBrush = BitmapFactory.DecodeResource(context.Resources, Resource.Drawable.HardBrush1))
                {
                    MemoryStream stream = new MemoryStream();
                    myBrush.Compress(Bitmap.CompressFormat.Png, 0, stream);
                    brushImage = stream.ToArray();
                    currentBrush = new BrushItem(4f, AnimationTypesBrushType.Normal, currentColor, inactiveColor, brushImage);
                }
            }

            myBitmap = Bitmap.CreateBitmap((int)wowZapp.LaffOutOut.Singleton.ScreenXWidth,
                                            (int)wowZapp.LaffOutOut.Singleton.ScreenYHeight / 2 /*- (int)ImageHelper.convertDpToPixel (320f, context)*/, Bitmap.Config.Argb8888);
            AnimationUtil.imagesForCanvas.Add(myBitmap);
            canvas = new Canvas(myBitmap);

            if (AnimationUtil.theImage == null)
                AnimationUtil.theImage = new Dictionary<int, List<ImageAttr>>();
            if (AnimationUtil.imgAttr == null)
                AnimationUtil.imgAttr = new List<ImageAttr>();
            AnimationUtil.imgAttr.Add(new ImageAttr());
            AnimationUtil.currentImage = 0;

            relLay.AddView(new CreateAnimationDrawer(context, currentBrush, canvas, myBitmap));

            if (AudioItems == null || AudioItems.Count == 0)
                AudioItems = new Dictionary<int, AnimationAudioInfo>();

            CurrentLayer = new FrameLayerPair(1, 1);

            dbm = LaffOutOut.Singleton.dbm;

            drawerState = false;

            btnBack.Click += delegate
            {
                SaveAnimation();
                Finish();
            };

            btnHome.Click += delegate
            {
                Intent i = new Intent(this, typeof(Main.HomeActivity));
                i.SetFlags(ActivityFlags.ClearTop);
                StartActivity(i);
            };

            imgUndo.Click += (object sender, EventArgs e) => {
                openDrawer(sender, e);};
            imgStamp.Click += (object sender, EventArgs e) => {
                openDrawer(sender, e);};
            imgPaint.Click += (object sender, EventArgs e) => {
                openDrawer(sender, e);};
            imgColour.Click += (object sender, EventArgs e) => {
                openDrawer(sender, e);};
            imgText.Click += (object sender, EventArgs e) => {
                openDrawer(sender, e);};
            imgComix.Click += (object sender, EventArgs e) => {
                openDrawer(sender, e);};
            imgSound.Click += (object sender, EventArgs e) => {
                openDrawer(sender, e);};
            imgPicture.Click += (object sender, EventArgs e) => {
                openDrawer(sender, e);};
            imgConfig.Click += (object sender, EventArgs e) => {
                openDrawer(sender, e);};

            imgPlayAnimation.Click += delegate
            {
                Intent m = new Intent(this, typeof(PlayAnimation));
                StartActivity(m);
            };
            modalPicture = new ImageView(context);
            percents = new TextView[4];
            colours = new ImageView[2];
        }
        public static void SetOneLayerActive(FrameLayerPair layer, Dictionary<int, FrameInfo> frameItems)
        {
            foreach (FrameInfo eachFrameItem in frameItems.Values) {

                foreach (LayerInfo eachLayerInfo in eachFrameItem.Layers.Values) {

                    if (eachFrameItem.ID == layer.FrameID) {
                        if (eachLayerInfo.ID == layer.LayerID) {
                            eachLayerInfo.IsCanvasActive = true;
                        } else {
                            eachLayerInfo.IsCanvasActive = false;
                        }//end if else
                    } else {

                        eachLayerInfo.IsCanvasActive = false;

                    }//end if else

                }//end foreach

            }//end foreach
        }