summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Hindenburg <[email protected]>2017-05-28 11:04:47 -0400
committerKurt Hindenburg <[email protected]>2017-05-28 11:04:47 -0400
commitde68973d078127ede7461b19df59428ff5a17df9 (patch)
tree178f25877d1ac1dff182c2de4032bee7682158e7
parent0fd9e2bd558206e06043c37f2933fe0480c47e59 (diff)
uncrustify using kf5 config
-rw-r--r--src/Character.h35
-rw-r--r--src/CharacterColor.h55
2 files changed, 45 insertions, 45 deletions
diff --git a/src/Character.h b/src/Character.h
index 15c677e..b7e2702 100644
--- a/src/Character.h
+++ b/src/Character.h
@@ -26,8 +26,7 @@
// Konsole
#include "CharacterColor.h"
-namespace Konsole
-{
+namespace Konsole {
typedef unsigned char LineProperty;
typedef quint16 RenditionFlags;
@@ -103,13 +102,13 @@ public:
quint16 character;
/** A combination of RENDITION flags which specify options for drawing the character. */
- RenditionFlags rendition;
+ RenditionFlags rendition;
/** The foreground color used to draw this character. */
- CharacterColor foregroundColor;
+ CharacterColor foregroundColor;
/** The color used to draw this character's background. */
- CharacterColor backgroundColor;
+ CharacterColor backgroundColor;
/** Indicate whether this character really exists, or exists simply as place holder.
*
@@ -125,21 +124,22 @@ public:
/**
* returns true if the format (color, rendition flag) of the compared characters is equal
*/
- bool equalsFormat(const Character& other) const;
+ bool equalsFormat(const Character &other) const;
/**
* Compares two characters and returns true if they have the same unicode character value,
* rendition and colors.
*/
- friend bool operator == (const Character& a, const Character& b);
+ friend bool operator ==(const Character &a, const Character &b);
/**
* Compares two characters and returns true if they have different unicode character values,
* renditions or colors.
*/
- friend bool operator != (const Character& a, const Character& b);
+ friend bool operator !=(const Character &a, const Character &b);
- inline bool isLineChar() const {
+ inline bool isLineChar() const
+ {
if (rendition & RE_EXTENDED_CHAR) {
return false;
} else {
@@ -147,7 +147,8 @@ public:
}
}
- inline bool isSpace() const {
+ inline bool isSpace() const
+ {
if (rendition & RE_EXTENDED_CHAR) {
return false;
} else {
@@ -156,25 +157,23 @@ public:
}
};
-inline bool operator == (const Character& a, const Character& b)
+inline bool operator ==(const Character &a, const Character &b)
{
return a.character == b.character && a.equalsFormat(b);
}
-inline bool operator != (const Character& a, const Character& b)
+inline bool operator !=(const Character &a, const Character &b)
{
return !operator==(a, b);
}
-inline bool Character::equalsFormat(const Character& other) const
+inline bool Character::equalsFormat(const Character &other) const
{
- return backgroundColor == other.backgroundColor &&
- foregroundColor == other.foregroundColor &&
- rendition == other.rendition;
+ return backgroundColor == other.backgroundColor
+ && foregroundColor == other.foregroundColor
+ && rendition == other.rendition;
}
-
}
Q_DECLARE_TYPEINFO(Konsole::Character, Q_MOVABLE_TYPE);
#endif // CHARACTER_H
-
diff --git a/src/CharacterColor.h b/src/CharacterColor.h
index 72de8d8..c265cae 100644
--- a/src/CharacterColor.h
+++ b/src/CharacterColor.h
@@ -26,8 +26,7 @@
// Qt
#include <QColor>
-namespace Konsole
-{
+namespace Konsole {
/**
* An entry in a terminal display's color palette.
*
@@ -80,12 +79,13 @@ class CharacterColor
public:
/** Constructs a new CharacterColor whose color and color space are undefined. */
- CharacterColor()
- : _colorSpace(COLOR_SPACE_UNDEFINED),
- _u(0),
- _v(0),
- _w(0)
- {}
+ CharacterColor() :
+ _colorSpace(COLOR_SPACE_UNDEFINED),
+ _u(0),
+ _v(0),
+ _w(0)
+ {
+ }
/**
* Constructs a new CharacterColor using the specified @p colorSpace and with
@@ -97,11 +97,12 @@ public:
*
* TODO : Add documentation about available color spaces.
*/
- CharacterColor(quint8 colorSpace, int co)
- : _colorSpace(colorSpace),
- _u(0),
- _v(0),
- _w(0) {
+ CharacterColor(quint8 colorSpace, int co) :
+ _colorSpace(colorSpace),
+ _u(0),
+ _v(0),
+ _w(0)
+ {
switch (colorSpace) {
case COLOR_SPACE_DEFAULT:
_u = co & 1;
@@ -126,7 +127,8 @@ public:
/**
* Returns true if this character color entry is valid.
*/
- bool isValid() const {
+ bool isValid() const
+ {
return _colorSpace != COLOR_SPACE_UNDEFINED;
}
@@ -152,18 +154,18 @@ public:
* The @p palette is only used if this color is one of the 16 system colors, otherwise
* it is ignored.
*/
- QColor color(const ColorEntry* palette) const;
+ QColor color(const ColorEntry *palette) const;
/**
* Compares two colors and returns true if they represent the same color value and
* use the same color space.
*/
- friend bool operator == (const CharacterColor& a, const CharacterColor& b);
+ friend bool operator ==(const CharacterColor &a, const CharacterColor &b);
/**
* Compares two colors and returns true if they represent different color values
* or use different color spaces.
*/
- friend bool operator != (const CharacterColor& a, const CharacterColor& b);
+ friend bool operator !=(const CharacterColor &a, const CharacterColor &b);
private:
quint8 _colorSpace;
@@ -174,19 +176,20 @@ private:
quint8 _w;
};
-inline bool operator == (const CharacterColor& a, const CharacterColor& b)
+inline bool operator ==(const CharacterColor &a, const CharacterColor &b)
{
- return a._colorSpace == b._colorSpace &&
- a._u == b._u &&
- a._v == b._v &&
- a._w == b._w;
+ return a._colorSpace == b._colorSpace
+ && a._u == b._u
+ && a._v == b._v
+ && a._w == b._w;
}
-inline bool operator != (const CharacterColor& a, const CharacterColor& b)
+
+inline bool operator !=(const CharacterColor &a, const CharacterColor &b)
{
return !operator==(a, b);
}
-inline const QColor color256(quint8 u, const ColorEntry* base)
+inline const QColor color256(quint8 u, const ColorEntry *base)
{
// 0.. 16: system colors
if (u < 8) {
@@ -212,7 +215,7 @@ inline const QColor color256(quint8 u, const ColorEntry* base)
return QColor(gray, gray, gray);
}
-inline QColor CharacterColor::color(const ColorEntry* base) const
+inline QColor CharacterColor::color(const ColorEntry *base) const
{
switch (_colorSpace) {
case COLOR_SPACE_DEFAULT:
@@ -245,8 +248,6 @@ inline void CharacterColor::setFaint()
_v = 2;
}
}
-
}
#endif // CHARACTERCOLOR_H
-