public void Update(libexeinfo.GEM.TreeObjectNode node, libexeinfo.GEM.ColorIcon colorIcon)
 {
     txtFlags.Text           = node.flags == 0 ? "None" : node.flags.ToString();
     txtState.Text           = node.state == 0 ? "Normal" : node.state.ToString();
     txtCoordinates.Text     = $"{colorIcon.Monochrome.X},{colorIcon.Monochrome.Y}";
     txtSize.Text            = $"{colorIcon.Monochrome.Width}x{colorIcon.Monochrome.Height} pixels";
     txtCharater.Text        = $"{colorIcon.Monochrome.Character}";
     txtCharCoordinates.Text = $"{colorIcon.Monochrome.CharX},{colorIcon.Monochrome.CharY}";
     txtFgColor.Text         = $"{colorIcon.Monochrome.ForegroundColor}";
     txtBgColor.Text         = $"{colorIcon.Monochrome.BackgroundColor}";
     txtTextCoordinates.Text = $"{colorIcon.Monochrome.TextX},{colorIcon.Monochrome.TextY}";
     txtTextBoxSize.Text     = $"{colorIcon.Monochrome.TextWidth}x{colorIcon.Monochrome.TextHeight} pixels";
     txtText.Text            = colorIcon.Monochrome.Text;
     imgIcon.Image           = GemIcon.GemIconToEto(colorIcon.Monochrome);
     treePlanes.DataStore    = colorIcon.Color;
     iconWidth  = (int)colorIcon.Monochrome.Width;
     iconHeight = (int)colorIcon.Monochrome.Height;
     treePlanes.SelectRow(0);
     if (colorIcon.Color != null && colorIcon.Color.Length >= 1 && colorIcon.Color[0] != null)
     {
         imgColorIcon.Image =
             GemColorIcon.GemColorIconToEto(colorIcon.Color[0], iconWidth, iconHeight, false);
         imgSelectedIcon.Image = GemColorIcon.GemColorIconToEto(colorIcon.Color[0], iconWidth, iconHeight, true);
     }
     else
     {
         imgColorIcon.Image    = null;
         imgSelectedIcon.Image = null;
     }
 }
Example #2
0
 public void Update(libexeinfo.GEM.TreeObjectNode node)
 {
     txtFlags.Text       = node.flags == 0 ? "None" : node.flags.ToString();
     txtState.Text       = node.state == 0 ? "Normal" : node.state.ToString();
     txtCoordinates.Text = $"{node.x},{node.y}";
     txtSize.Text        = $"{node.width}x{node.height} pixels";
     txtData.Text        = $"{node.data}";
 }
Example #3
0
 public void Update(libexeinfo.GEM.TreeObjectNode node)
 {
     txtFlags.Text       = node.flags == 0 ? "None" : node.flags.ToString();
     txtState.Text       = node.state == 0 ? "Normal" : node.state.ToString();
     txtCoordinates.Text = $"{node.BitBlock.X},{node.BitBlock.Y}";
     txtSize.Text        = $"{node.BitBlock.Width}x{node.BitBlock.Height} pixels";
     txtColor.Text       = $"{node.BitBlock.Color}";
     imgImage.Image      = GemImageToEto(node);
 }
Example #4
0
        public void Update(libexeinfo.GEM.TreeObjectNode node)
        {
            sbyte thickness = (sbyte)((node.data & 0xFF0000) >> 16);

            char character = Encoding.AtariSTEncoding.GetString(new[] { (byte)((node.data & 0xFF000000) >> 24) })[0];

            txtFlags.Text       = node.flags == 0 ? "None" : node.flags.ToString();
            txtState.Text       = node.state == 0 ? "Normal" : node.state.ToString();
            txtCoordinates.Text = $"{node.x},{node.y}";
            txtSize.Text        = $"{node.width}x{node.height} pixels";
            txtBorderColor.Text =
                ((libexeinfo.GEM.ObjectColors)((node.data & 0xFFFF & libexeinfo.GEM.BorderColorMask) >> 12)).ToString();
            txtFill.Text =
                ((libexeinfo.GEM.ObjectFillPattern)((node.data & 0xFFFF & libexeinfo.GEM.FillPatternMask) >> 4))
                .ToString();
            txtInsideColor.Text =
                ((libexeinfo.GEM.ObjectColors)((node.data & 0xFFFF & libexeinfo.GEM.InsideColorMask) >> 8)).ToString();
            txtTextColor.Text =
                ((libexeinfo.GEM.ObjectColors)((node.data & 0xFFFF & libexeinfo.GEM.TextColorMask) >> 8)).ToString();
            txtTransparency.Text = (node.data & 0xFFFF & libexeinfo.GEM.TransparentColor) != 0
                                       ? "Transparent mode"
                                       : "Replace mode";
            if (thickness < 0)
            {
                txtThickness.Text = $"{thickness * -1} pixels outward";
            }
            else if (thickness < 0)
            {
                txtThickness.Text = $"{thickness} pixels inward";
            }
            else
            {
                txtThickness.Text = "None";
            }
            txtCharacter.Text = new string(new [] { character });

            if (node.type == libexeinfo.GEM.ObjectTypes.G_BOXCHAR)
            {
                txtCharacter.Visible = true;
                txtThickness.Visible = true;
                lblCharacter.Visible = true;
                lblThickness.Visible = true;
            }
            else
            {
                txtCharacter.Visible = false;
                txtThickness.Visible = false;
                lblCharacter.Visible = false;
                lblThickness.Visible = false;
            }
        }
Example #5
0
 public void Update(libexeinfo.GEM.TreeObjectNode node)
 {
     txtFlags.Text           = node.flags == 0 ? "None" : node.flags.ToString();
     txtState.Text           = node.state == 0 ? "Normal" : node.state.ToString();
     txtCoordinates.Text     = $"{node.IconBlock.X},{node.IconBlock.Y}";
     txtSize.Text            = $"{node.IconBlock.Width}x{node.IconBlock.Height} pixels";
     txtCharater.Text        = $"{node.IconBlock.Character}";
     txtCharCoordinates.Text = $"{node.IconBlock.CharX},{node.IconBlock.CharY}";
     txtFgColor.Text         = $"{node.IconBlock.ForegroundColor}";
     txtBgColor.Text         = $"{node.IconBlock.BackgroundColor}";
     txtTextCoordinates.Text = $"{node.IconBlock.TextX},{node.IconBlock.TextY}";
     txtTextBoxSize.Text     = $"{node.IconBlock.TextWidth}x{node.IconBlock.TextHeight} pixels";
     txtText.Text            = node.IconBlock.Text;
     imgIcon.Image           = GemIcon.GemIconToEto(node.IconBlock);
 }
Example #6
0
        static Bitmap GemImageToEto(libexeinfo.GEM.TreeObjectNode node)
        {
            Color color = GemColor.GemToEtoColor(node.BitBlock.Color);
            Color background;

            background = GemColor.GemToEtoColor(node.BitBlock.Color == libexeinfo.GEM.ObjectColors.White
                                                    ? libexeinfo.GEM.ObjectColors.Black
                                                    : libexeinfo.GEM.ObjectColors.White);

            List <Color> pixels = new List <Color>();

            byte[] data = new byte[node.BitBlock.Data.Length];
            int    pos  = 0;
            int    w    = (int)(node.BitBlock.Width / 8);

            // This flips the image.
            while (pos < data.Length)
            {
                for (int i = 0; i < w; i++)
                {
                    byte b = node.BitBlock.Data[pos + i];
                    data[pos + i]  = (byte)(b >> 7);
                    data[pos + i] += (byte)((b >> 5) & 0x02);
                    data[pos + i] += (byte)((b >> 3) & 0x04);
                    data[pos + i] += (byte)((b >> 1) & 0x08);
                    data[pos + i] += (byte)((b << 1) & 0x10);
                    data[pos + i] += (byte)((b << 3) & 0x20);
                    data[pos + i] += (byte)((b << 5) & 0x40);
                    data[pos + i] += (byte)(b << 7);
                }

                pos += w;
            }

            foreach (byte b in data)
            {
                for (int i = 0; i < 8; i++)
                {
                    pixels.Add((b & (1 << i)) != 0 ? color : background);
                }
            }

            return(new Bitmap((int)node.BitBlock.Width, (int)node.BitBlock.Height, PixelFormat.Format32bppRgb, pixels));
        }
        static void AddObjectToTree(TreeGridItem parent, libexeinfo.GEM.TreeObjectNode node)
        {
            while (true)
            {
                TreeGridItem item = new TreeGridItem {
                    Values = new object[] { $"{node.type}", node }
                };

                if (node.child != null)
                {
                    AddObjectToTree(item, node.child);
                }

                parent.Children.Add(item);

                if (node.sibling != null)
                {
                    node = node.sibling;
                    continue;
                }

                break;
            }
        }
Example #8
0
        public void Update(libexeinfo.GEM.TreeObjectNode node)
        {
            txtFlags.Text         = node.flags == 0 ? "None" : node.flags.ToString();
            txtState.Text         = node.state == 0 ? "Normal" : node.state.ToString();
            txtCoordinates.Text   = $"{node.x},{node.y}";
            txtSize.Text          = $"{node.width}x{node.height} pixels";
            txtBorderColor.Text   = $"{node.TedInfo.BorderColor}";
            txtFill.Text          = $"{node.TedInfo.Fill}";
            txtFont.Text          = $"{node.TedInfo.Font}";
            txtInsideColor.Text   = $"{node.TedInfo.InsideColor}";
            txtJustification.Text = $"{node.TedInfo.Justification}";
            txtTemplate.Text      = node.TedInfo.Template;
            txtText.Text          = node.TedInfo.Text;
            txtTextColor.Text     = $"{node.TedInfo.TextColor}";
            txtTransparency.Text  =
                node.TedInfo.Transparency ? "Transparent mode" : "Replace mode";
            txtValidation.Text = node.TedInfo.Validation;
            if (node.TedInfo.Thickness < 0)
            {
                txtThickness.Text = $"{node.TedInfo.Thickness * -1} pixels outward";
            }
            else if (node.TedInfo.Thickness < 0)
            {
                txtThickness.Text = $"{node.TedInfo.Thickness} pixels inward";
            }
            else
            {
                txtThickness.Text = "None";
            }

            if (string.IsNullOrWhiteSpace(node.TedInfo.Template))
            {
                txtTemplate.Visible = false;
                lblTemplate.Visible = false;
            }
            else
            {
                txtTemplate.Visible = true;
                lblTemplate.Visible = true;
            }

            if (string.IsNullOrWhiteSpace(node.TedInfo.Text))
            {
                txtText.Visible = false;
                lblText.Visible = false;
            }
            else
            {
                txtText.Visible = true;
                lblText.Visible = true;
            }

            if (string.IsNullOrWhiteSpace(node.TedInfo.Validation))
            {
                txtValidation.Visible = false;
                lblValidation.Visible = false;
            }
            else
            {
                txtValidation.Visible = true;
                lblValidation.Visible = true;
            }

            if (!string.IsNullOrEmpty(node.TedInfo.Template))
            {
                if (string.IsNullOrEmpty(node.TedInfo.Text))
                {
                    txtPreview.Text = node.TedInfo.Template;
                }
                else
                {
                    char[] preview  = node.TedInfo.Template.ToCharArray();
                    char[] template = node.TedInfo.Text.ToCharArray();
                    if (template[0] == '@')
                    {
                        for (int i = 0; i < template.Length; i++)
                        {
                            template[i] = ' ';
                        }
                    }

                    int templatePos = 0;

                    for (int i = 0; i < preview.Length; i++)
                    {
                        if (preview[i] != '_')
                        {
                            continue;
                        }

                        if (templatePos >= template.Length)
                        {
                            continue;
                        }

                        preview[i] = template[templatePos];
                        templatePos++;
                    }

                    txtPreview.Text = new string(preview);
                }
            }
            else
            {
                txtPreview.Text = txtText.Text;
            }

            txtPreview.BackgroundColor = GemColor.GemToEtoColor(node.TedInfo.InsideColor);
            txtPreview.TextColor       = GemColor.GemToEtoColor(node.TedInfo.TextColor);
        }