[Konsole-devel] [konsole] src: Move class AccessibleColorScheme into its own files

Kurt Hindenburg kurt.hindenburg at gmail.com
Thu Nov 22 23:59:14 UTC 2012


Thanks, I would tend to agree that this class can be removed.  Kurt


On Mon, Nov 19, 2012 at 1:15 PM, Jekyll Wu <adaptee at gmail.com> wrote:

> Git commit d8f22c821a9a5833bb0770144f887ad877bc802f by Jekyll Wu.
> Committed on 19/11/2012 at 18:57.
> Pushed by jekyllwu into branch 'master'.
>
> Move class AccessibleColorScheme into its own files
>
> Note: this special colorscheme has never been exposed and put into use,
> so the new files are not involved in the building process.
>
> Maybe that special colorscheme should just be removed, if no one now
> really understands its design purpose.
>
> A  +91   -0    src/AccessibleColorScheme.cpp     [License: GPL (v2+)]
> A  +47   -0    src/AccessibleColorScheme.h     [License: GPL (v2+)]
> M  +0    -61   src/ColorScheme.cpp
> M  +0    -14   src/ColorScheme.h
>
> http://commits.kde.org/konsole/d8f22c821a9a5833bb0770144f887ad877bc802f
>
> diff --git a/src/AccessibleColorScheme.cpp b/src/AccessibleColorScheme.cpp
> new file mode 100644
> index 0000000..f2f7319
> --- /dev/null
> +++ b/src/AccessibleColorScheme.cpp
> @@ -0,0 +1,91 @@
> +/*
> +    This source file is part of Konsole, a terminal emulator.
> +
> +    Copyright 2007-2008 by Robert Knight <robertknight at gmail.com>
> +
> +    This program is free software; you can redistribute it and/or modify
> +    it under the terms of the GNU General Public License as published by
> +    the Free Software Foundation; either version 2 of the License, or
> +    (at your option) any later version.
> +
> +    This program is distributed in the hope that it will be useful,
> +    but WITHOUT ANY WARRANTY; without even the implied warranty of
> +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +    GNU General Public License for more details.
> +
> +    You should have received a copy of the GNU General Public License
> +    along with this program; if not, write to the Free Software
> +    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> +    02110-1301  USA.
> +*/
> +
> +// Own
> +#include "AccessibleColorScheme.h"
> +
> +// Qt
> +#include <QtGui/QBrush>
> +
> +// KDE
> +#include <KColorScheme>
> +#include <KLocalizedString>
> +
> +using namespace Konsole;
> +
> +// Work In Progress - A color scheme for use on KDE setups for users
> +// with visual disabilities which means that they may have trouble
> +// reading text with the supplied color schemes.
> +//
> +// This color scheme uses only the 'safe' colors defined by the
> +// KColorScheme class.
> +//
> +// A complication this introduces is that each color provided by
> +// KColorScheme is defined as a 'background' or 'foreground' color.
> +// Only foreground colors are allowed to be used to render text and
> +// only background colors are allowed to be used for backgrounds.
> +//
> +// The ColorEntry and TerminalDisplay classes do not currently
> +// support this restriction.
> +//
> +// Requirements:
> +//  - A color scheme which uses only colors from the KColorScheme class
> +//  - Ability to restrict which colors the TerminalDisplay widget
> +//    uses as foreground and background color
> +//  - Make use of KGlobalSettings::allowDefaultBackgroundImages() as
> +//    a hint to determine whether this accessible color scheme should
> +//    be used by default.
> +//
> +//
> +// -- Robert Knight <robertknight at gmail.com> 21/07/2007
> +//
> +AccessibleColorScheme::AccessibleColorScheme()
> +    : ColorScheme()
> +{
> +    // basic attributes
> +    setName("accessible");
> +    setDescription(i18n("Accessible Color Scheme"));
> +
> +    // setup colors
> +    const int ColorRoleCount = 8;
> +
> +    const KColorScheme colorScheme(QPalette::Active);
> +
> +    QBrush colors[ColorRoleCount] = {
> +        colorScheme.foreground(colorScheme.NormalText),
> +        colorScheme.background(colorScheme.NormalBackground),
> +
> +        colorScheme.foreground(colorScheme.InactiveText),
> +        colorScheme.foreground(colorScheme.ActiveText),
> +        colorScheme.foreground(colorScheme.LinkText),
> +        colorScheme.foreground(colorScheme.VisitedText),
> +        colorScheme.foreground(colorScheme.NegativeText),
> +        colorScheme.foreground(colorScheme.NeutralText)
> +    };
> +
> +    for (int i = 0 ; i < TABLE_COLORS ; i++) {
> +        ColorEntry entry;
> +        entry.color = colors[ i % ColorRoleCount ].color();
> +
> +        setColorTableEntry(i , entry);
> +    }
> +}
> +
> diff --git a/src/AccessibleColorScheme.h b/src/AccessibleColorScheme.h
> new file mode 100644
> index 0000000..931c31a
> --- /dev/null
> +++ b/src/AccessibleColorScheme.h
> @@ -0,0 +1,47 @@
> +/*
> +    This source file is part of Konsole, a terminal emulator.
> +
> +    Copyright 2007-2008 by Robert Knight <robertknight at gmail.com>
> +
> +    This program is free software; you can redistribute it and/or modify
> +    it under the terms of the GNU General Public License as published by
> +    the Free Software Foundation; either version 2 of the License, or
> +    (at your option) any later version.
> +
> +    This program is distributed in the hope that it will be useful,
> +    but WITHOUT ANY WARRANTY; without even the implied warranty of
> +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +    GNU General Public License for more details.
> +
> +    You should have received a copy of the GNU General Public License
> +    along with this program; if not, write to the Free Software
> +    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> +    02110-1301  USA.
> +*/
> +
> +#ifndef ACCESSIBLECOLORSCHEME_H
> +#define ACCESSIBLECOLORSCHEME_H
> +
> +// Konsole
> +#include "ColorScheme.h"
> +
> +namespace Konsole
> +{
> +
> +/**
> + * A color scheme which uses colors from the standard KDE color palette.
> + *
> + * This is designed primarily for the benefit of users who are using
> specially
> + * designed colors.
> + *
> + * TODO Implement and make it the default on systems with specialized KDE
> + * color schemes.
> + */
> +class AccessibleColorScheme : public ColorScheme
> +{
> +public:
> +    AccessibleColorScheme();
> +};
> +}
> +
> +#endif //ACCESSIBLECOLORSCHEME_H
> diff --git a/src/ColorScheme.cpp b/src/ColorScheme.cpp
> index b06defa..1f27c94 100644
> --- a/src/ColorScheme.cpp
> +++ b/src/ColorScheme.cpp
> @@ -23,11 +23,9 @@
>  #include "ColorScheme.h"
>
>  // Qt
> -#include <QtGui/QBrush>
>  #include <QtGui/QPainter>
>
>  // KDE
> -#include <KColorScheme>
>  #include <KConfig>
>  #include <KLocalizedString>
>  #include <KConfigGroup>
> @@ -424,62 +422,3 @@ QString ColorSchemeWallpaper::path() const
>      return _path;
>  }
>
> -//
> -// Work In Progress - A color scheme for use on KDE setups for users
> -// with visual disabilities which means that they may have trouble
> -// reading text with the supplied color schemes.
> -//
> -// This color scheme uses only the 'safe' colors defined by the
> -// KColorScheme class.
> -//
> -// A complication this introduces is that each color provided by
> -// KColorScheme is defined as a 'background' or 'foreground' color.
> -// Only foreground colors are allowed to be used to render text and
> -// only background colors are allowed to be used for backgrounds.
> -//
> -// The ColorEntry and TerminalDisplay classes do not currently
> -// support this restriction.
> -//
> -// Requirements:
> -//  - A color scheme which uses only colors from the KColorScheme class
> -//  - Ability to restrict which colors the TerminalDisplay widget
> -//    uses as foreground and background color
> -//  - Make use of KGlobalSettings::allowDefaultBackgroundImages() as
> -//    a hint to determine whether this accessible color scheme should
> -//    be used by default.
> -//
> -//
> -// -- Robert Knight <robertknight at gmail.com> 21/07/2007
> -//
> -AccessibleColorScheme::AccessibleColorScheme()
> -    : ColorScheme()
> -{
> -    // basic attributes
> -    setName("accessible");
> -    setDescription(i18n("Accessible Color Scheme"));
> -
> -    // setup colors
> -    const int ColorRoleCount = 8;
> -
> -    const KColorScheme colorScheme(QPalette::Active);
> -
> -    QBrush colors[ColorRoleCount] = {
> -        colorScheme.foreground(colorScheme.NormalText),
> -        colorScheme.background(colorScheme.NormalBackground),
> -
> -        colorScheme.foreground(colorScheme.InactiveText),
> -        colorScheme.foreground(colorScheme.ActiveText),
> -        colorScheme.foreground(colorScheme.LinkText),
> -        colorScheme.foreground(colorScheme.VisitedText),
> -        colorScheme.foreground(colorScheme.NegativeText),
> -        colorScheme.foreground(colorScheme.NeutralText)
> -    };
> -
> -    for (int i = 0 ; i < TABLE_COLORS ; i++) {
> -        ColorEntry entry;
> -        entry.color = colors[ i % ColorRoleCount ].color();
> -
> -        setColorTableEntry(i , entry);
> -    }
> -}
> -
> diff --git a/src/ColorScheme.h b/src/ColorScheme.h
> index 107516f..35c948e 100644
> --- a/src/ColorScheme.h
> +++ b/src/ColorScheme.h
> @@ -225,20 +225,6 @@ private:
>      static const char* const translatedColorNames[TABLE_COLORS];
>  };
>
> -/**
> - * A color scheme which uses colors from the standard KDE color palette.
> - *
> - * This is designed primarily for the benefit of users who are using
> specially
> - * designed colors.
> - *
> - * TODO Implement and make it the default on systems with specialized KDE
> - * color schemes.
> - */
> -class AccessibleColorScheme : public ColorScheme
> -{
> -public:
> -    AccessibleColorScheme();
> -};
>  }
>
>  Q_DECLARE_METATYPE(const Konsole::ColorScheme*)
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/konsole-devel/attachments/20121122/23140611/attachment.html>


More information about the konsole-devel mailing list