Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
267cc34e
Commit
267cc34e
authored
Jul 16, 2020
by
Gustavo Carneiro
Browse files
Move CharacterFormat class to a new file.
parent
f2c3d18e
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/CMakeLists.txt
View file @
267cc34e
...
...
@@ -68,6 +68,7 @@ set(konsoleprivate_SRCS ${sessionadaptors_SRCS}
HistoryScroll.cpp
HistoryScrollFile.cpp
HistoryScrollNone.cpp
CharacterFormat.cpp
HistorySizeDialog.cpp
widgets/HistorySizeWidget.cpp
widgets/IncrementalSearchBar.cpp
...
...
src/CharacterFormat.cpp
0 → 100644
View file @
267cc34e
/*
This file is part of Konsole, an X terminal.
Copyright 1997,1998 by Lars Doelle <lars.doelle@on-line.de>
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.
*/
#include "CharacterFormat.h"
using
namespace
Konsole
;
bool
CharacterFormat
::
equalsFormat
(
const
CharacterFormat
&
other
)
const
{
return
(
other
.
rendition
&
~
RE_EXTENDED_CHAR
)
==
(
rendition
&
~
RE_EXTENDED_CHAR
)
&&
other
.
fgColor
==
fgColor
&&
other
.
bgColor
==
bgColor
;
}
bool
CharacterFormat
::
equalsFormat
(
const
Character
&
c
)
const
{
return
(
c
.
rendition
&
~
RE_EXTENDED_CHAR
)
==
(
rendition
&
~
RE_EXTENDED_CHAR
)
&&
c
.
foregroundColor
==
fgColor
&&
c
.
backgroundColor
==
bgColor
;
}
void
CharacterFormat
::
setFormat
(
const
Character
&
c
)
{
rendition
=
c
.
rendition
;
fgColor
=
c
.
foregroundColor
;
bgColor
=
c
.
backgroundColor
;
isRealCharacter
=
c
.
isRealCharacter
;
}
src/CharacterFormat.h
0 → 100644
View file @
267cc34e
/*
This file is part of Konsole, an X terminal.
Copyright 1997,1998 by Lars Doelle <lars.doelle@on-line.de>
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 CHARACTERFORMAT_H
#define CHARACTERFORMAT_H
#include "Character.h"
namespace
Konsole
{
class
CharacterFormat
{
public:
bool
equalsFormat
(
const
CharacterFormat
&
other
)
const
;
bool
equalsFormat
(
const
Character
&
c
)
const
;
void
setFormat
(
const
Character
&
c
);
CharacterColor
fgColor
,
bgColor
;
quint16
startPos
;
RenditionFlags
rendition
;
bool
isRealCharacter
;
};
}
#endif
src/History.h
View file @
267cc34e
...
...
@@ -36,6 +36,7 @@
#include "HistoryScroll.h"
#include "HistoryScrollFile.h"
#include "HistoryScrollNone.h"
#include "CharacterFormat.h"
// Konsole
#include "Character.h"
...
...
@@ -49,35 +50,6 @@ namespace Konsole {
//////////////////////////////////////////////////////////////////////
typedef
QVector
<
Character
>
TextLine
;
class
CharacterFormat
{
public:
bool
equalsFormat
(
const
CharacterFormat
&
other
)
const
{
return
(
other
.
rendition
&
~
RE_EXTENDED_CHAR
)
==
(
rendition
&
~
RE_EXTENDED_CHAR
)
&&
other
.
fgColor
==
fgColor
&&
other
.
bgColor
==
bgColor
;
}
bool
equalsFormat
(
const
Character
&
c
)
const
{
return
(
c
.
rendition
&
~
RE_EXTENDED_CHAR
)
==
(
rendition
&
~
RE_EXTENDED_CHAR
)
&&
c
.
foregroundColor
==
fgColor
&&
c
.
backgroundColor
==
bgColor
;
}
void
setFormat
(
const
Character
&
c
)
{
rendition
=
c
.
rendition
;
fgColor
=
c
.
foregroundColor
;
bgColor
=
c
.
backgroundColor
;
isRealCharacter
=
c
.
isRealCharacter
;
}
CharacterColor
fgColor
,
bgColor
;
quint16
startPos
;
RenditionFlags
rendition
;
bool
isRealCharacter
;
};
class
CompactHistoryBlock
{
public:
...
...
src/autotests/HistoryTest.cpp
View file @
267cc34e
...
...
@@ -26,6 +26,7 @@
#include "../session/Session.h"
#include "../Emulation.h"
#include "../History.h"
#include "../HistoryScrollFile.h"
using
namespace
Konsole
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment