Ejemplo n.º 1
0
            public Information()
            {
                FontName     = "Courier 12";
                FontLanguage = "utf-8";

                fgNormal    = new Drawer.Color[2, 2];
                bgNormal    = new Drawer.Color[2, 2];
                fgUnfocused = new Drawer.Color[2, 2];

                fgHighlight = new Drawer.Color[2, (int)HighlightType.Sentinel];
                bgHighlight = new Drawer.Color[2, (int)HighlightType.Sentinel];

                for (int i = 0; i < 2; i++)
                {
                    fgNormal[0, i] = new Drawer.Color(Gdk.Color.Zero);
                    fgNormal[1, i] = new Drawer.Color(Gdk.Color.Zero);
                    bgNormal[0, i] = new Drawer.Color(Gdk.Color.Zero);
                    bgNormal[1, i] = new Drawer.Color(Gdk.Color.Zero);
                }

                // initialize default colors
                Gdk.Color.Parse("black", ref fgNormal[(int)RowType.Even, (int)ColumnType.Even].GdkColor);
                Gdk.Color.Parse("white", ref bgNormal[(int)RowType.Even, (int)ColumnType.Even].GdkColor);

                Gdk.Color.Parse("blue", ref fgNormal[(int)RowType.Even, (int)ColumnType.Odd].GdkColor);
                Gdk.Color.Parse("white", ref bgNormal[(int)RowType.Even, (int)ColumnType.Odd].GdkColor);

                Gdk.Color.Parse("black", ref fgNormal[(int)RowType.Odd, (int)ColumnType.Even].GdkColor);
                Gdk.Color.Parse("white", ref bgNormal[(int)RowType.Odd, (int)ColumnType.Even].GdkColor);

                Gdk.Color.Parse("blue", ref fgNormal[(int)RowType.Odd, (int)ColumnType.Odd].GdkColor);
                Gdk.Color.Parse("white", ref bgNormal[(int)RowType.Odd, (int)ColumnType.Odd].GdkColor);

                for (int i = 0; i < 2; i++)
                {
                    fgUnfocused[0, i] = new Drawer.Color(MakeColorLighter(fgNormal[0, i].GdkColor, 0.7));
                    fgUnfocused[1, i] = new Drawer.Color(MakeColorLighter(fgNormal[1, i].GdkColor, 0.7));
                }

                // leave unspecified...
                // if not specified by user they will
                // be set up using theme defaults
                for (int i = 0; i < (int)HighlightType.Sentinel; i++)
                {
                    fgHighlight[(int)RowType.Even, i] = null;
                    bgHighlight[(int)RowType.Even, i] = null;

                    fgHighlight[(int)RowType.Odd, i] = null;
                    bgHighlight[(int)RowType.Odd, i] = null;
                }

                Uppercase = false;
            }
Ejemplo n.º 2
0
        ///<summary>
        /// Wrapper around create to avoid creating pixmaps we already have
        ///</summary>
        private Gdk.Pixmap CreateWrapper(Drawer.Color fg, Drawer.Color bg)
        {
            string id = PixmapManager.Instance.GetPixmapId(this.GetType(), info, fg.GdkColor, bg.GdkColor);

            Gdk.Pixmap pix = PixmapManager.Instance.GetPixmap(id);
            if (pix == null)
            {
                pix = Create(fg.GdkColor, bg.GdkColor);         // can be null for DummyDrawer
                if (pix != null)
                {
                    PixmapManager.Instance.AddPixmap(id, pix);
                    PixmapManager.Instance.ReferencePixmap(id);
                    pixmapIds.Add(id);
                }
            }
            else
            {
                PixmapManager.Instance.ReferencePixmap(id);
                pixmapIds.Add(id);
            }

            return(pix);
        }