Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Krita
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tusooa Zhu
Krita
Commits
bdc3ec09
Commit
bdc3ec09
authored
Jul 18, 2007
by
Thomas Zander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create a PaintContext for the KoTextDocumentLayout which holds the viewConverter.
svn path=/trunk/koffice/; revision=689412
parent
8f557148
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
libs/kotext/KoTextDocumentLayout.cpp
libs/kotext/KoTextDocumentLayout.cpp
+7
-5
libs/kotext/KoTextDocumentLayout.h
libs/kotext/KoTextDocumentLayout.h
+10
-3
No files found.
libs/kotext/KoTextDocumentLayout.cpp
View file @
bdc3ec09
...
@@ -51,7 +51,7 @@ public:
...
@@ -51,7 +51,7 @@ public:
bool
nextParag
()
{
return
false
;
}
bool
nextParag
()
{
return
false
;
}
bool
previousParag
()
{
return
false
;
}
bool
previousParag
()
{
return
false
;
}
double
documentOffsetInShape
()
{
return
0
;
}
double
documentOffsetInShape
()
{
return
0
;
}
void
draw
(
QPainter
*
,
const
QAbstractTextDocumentLayout
::
PaintContext
&
,
const
KoViewConverter
*
)
{}
void
draw
(
QPainter
*
,
const
KoTextDocumentLayout
::
PaintContext
&
)
{}
KoStyleManager
*
styleManager
()
const
{
return
m_styleManager
;
}
KoStyleManager
*
styleManager
()
const
{
return
m_styleManager
;
}
void
setStyleManager
(
KoStyleManager
*
sm
)
{
m_styleManager
=
sm
;
}
void
setStyleManager
(
KoStyleManager
*
sm
)
{
m_styleManager
=
sm
;
}
bool
setFollowupShape
(
KoShape
*
)
{
return
false
;
}
bool
setFollowupShape
(
KoShape
*
)
{
return
false
;
}
...
@@ -157,12 +157,14 @@ QSizeF KoTextDocumentLayout::documentSize() const {
...
@@ -157,12 +157,14 @@ QSizeF KoTextDocumentLayout::documentSize() const {
return
QSizeF
(
10
,
10
);
return
QSizeF
(
10
,
10
);
}
}
void
KoTextDocumentLayout
::
draw
(
QPainter
*
painter
,
const
PaintContext
&
context
)
{
void
KoTextDocumentLayout
::
draw
(
QPainter
*
painter
,
const
QAbstractTextDocumentLayout
::
PaintContext
&
context
)
{
m_state
->
draw
(
painter
,
context
,
0
);
PaintContext
pc
;
pc
.
textContext
=
context
;
m_state
->
draw
(
painter
,
pc
);
}
}
void
KoTextDocumentLayout
::
draw
(
QPainter
*
painter
,
const
PaintContext
&
context
,
const
KoViewConverter
*
converter
)
{
void
KoTextDocumentLayout
::
draw
(
QPainter
*
painter
,
const
KoTextDocumentLayout
::
PaintContext
&
context
)
{
m_state
->
draw
(
painter
,
context
,
converter
);
m_state
->
draw
(
painter
,
context
);
}
}
QRectF
KoTextDocumentLayout
::
frameBoundingRect
(
QTextFrame
*
frame
)
const
{
QRectF
KoTextDocumentLayout
::
frameBoundingRect
(
QTextFrame
*
frame
)
const
{
...
...
libs/kotext/KoTextDocumentLayout.h
View file @
bdc3ec09
...
@@ -42,6 +42,13 @@ class KOTEXT_EXPORT KoTextDocumentLayout : public QAbstractTextDocumentLayout {
...
@@ -42,6 +42,13 @@ class KOTEXT_EXPORT KoTextDocumentLayout : public QAbstractTextDocumentLayout {
Q_OBJECT
Q_OBJECT
public:
public:
class
LayoutState
;
class
LayoutState
;
struct
PaintContext
{
PaintContext
()
:
viewConverter
(
0
)
{
}
QAbstractTextDocumentLayout
::
PaintContext
textContext
;
const
KoViewConverter
*
viewConverter
;
};
/// constructor
/// constructor
explicit
KoTextDocumentLayout
(
QTextDocument
*
document
,
KoTextDocumentLayout
::
LayoutState
*
layout
=
0
);
explicit
KoTextDocumentLayout
(
QTextDocument
*
document
,
KoTextDocumentLayout
::
LayoutState
*
layout
=
0
);
virtual
~
KoTextDocumentLayout
();
virtual
~
KoTextDocumentLayout
();
...
@@ -74,9 +81,9 @@ public:
...
@@ -74,9 +81,9 @@ public:
*/
*/
virtual
QSizeF
documentSize
()
const
;
virtual
QSizeF
documentSize
()
const
;
/// Draws the layout on the given painter with the given context.
/// Draws the layout on the given painter with the given context.
virtual
void
draw
(
QPainter
*
painter
,
const
PaintContext
&
context
);
virtual
void
draw
(
QPainter
*
painter
,
const
QAbstractTextDocumentLayout
::
PaintContext
&
context
);
/// Draws the layout on the given painter with the given context, and pass the zoom.
/// Draws the layout on the given painter with the given context, and pass the zoom.
void
draw
(
QPainter
*
painter
,
const
PaintContext
&
context
,
const
KoViewConverter
*
converter
);
void
draw
(
QPainter
*
painter
,
const
KoTextDocumentLayout
::
PaintContext
&
context
);
/// Returns the bounding rectacle of frame. Returns the bounding rectangle of frame.
/// Returns the bounding rectacle of frame. Returns the bounding rectangle of frame.
virtual
QRectF
frameBoundingRect
(
QTextFrame
*
frame
)
const
;
virtual
QRectF
frameBoundingRect
(
QTextFrame
*
frame
)
const
;
/**
/**
...
@@ -144,7 +151,7 @@ public:
...
@@ -144,7 +151,7 @@ public:
/// Return the y position of the offset for the current shape (See KoTextShapeData::documentOffset() )
/// Return the y position of the offset for the current shape (See KoTextShapeData::documentOffset() )
virtual
double
documentOffsetInShape
()
=
0
;
virtual
double
documentOffsetInShape
()
=
0
;
/// paint the document
/// paint the document
virtual
void
draw
(
QPainter
*
painter
,
const
PaintContext
&
context
,
const
KoViewConverter
*
converter
)
=
0
;
virtual
void
draw
(
QPainter
*
painter
,
const
KoTextDocumentLayout
::
PaintContext
&
context
)
=
0
;
/**
/**
* After all shapes have been used and there is still text left, use the param shape to continue
* After all shapes have been used and there is still text left, use the param shape to continue
* layout.
* layout.
...
...
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