Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Andi Sardina Ramos
Okular
Commits
178bab06
Commit
178bab06
authored
Mar 21, 2006
by
Albert Astals Cid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core builds
svn path=/branches/work/kde4/playground/graphics/okular/; revision=521179
parent
b2f5f335
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
17 deletions
+19
-17
core/area.h
core/area.h
+9
-9
core/document.cpp
core/document.cpp
+6
-6
core/generator.cpp
core/generator.cpp
+3
-1
core/generator.h
core/generator.h
+1
-1
No files found.
core/area.h
View file @
178bab06
...
...
@@ -108,13 +108,13 @@ struct HighlightRect : public NormalizedRect
*/
template
<
class
NormalizedShape
,
class
Shape
>
class
RegularArea
:
public
QList
<
NormalizedShape
*
>
public
QList
<
NormalizedShape
>
{
public:
bool
contains
(
double
x
,
double
y
)
const
;
bool
contains
(
NormalizedShape
*
)
const
;
bool
contains
(
NormalizedShape
)
const
;
bool
intersects
(
const
RegularArea
<
NormalizedShape
,
Shape
>
*
area
)
const
;
bool
intersects
(
const
NormalizedShape
*
shape
)
const
;
bool
intersects
(
const
NormalizedShape
shape
)
const
;
void
appendArea
(
const
RegularArea
<
NormalizedShape
,
Shape
>
*
area
);
void
simplify
();
bool
isNull
()
const
;
...
...
@@ -125,7 +125,7 @@ template <class NormalizedShape, class Shape>
void
RegularArea
<
NormalizedShape
,
Shape
>::
simplify
()
{
int
end
=
this
->
count
(),
i
=
0
,
x
=
0
;
QList
<
NormalizedShape
*
>
m_remove
;
QList
<
NormalizedShape
>
m_remove
;
for
(;
i
<
end
;
i
++
)
{
if
(
i
<
(
end
-
1
)
)
...
...
@@ -158,7 +158,7 @@ bool RegularArea<NormalizedShape, Shape>::isNull() const
if
(
this
->
isEmpty
())
return
false
;
foreach
(
const
NormalizedShape
*
ns
,
this
)
foreach
(
const
NormalizedShape
ns
,
*
this
)
if
(
!
(
ns
->
isNull
()))
return
false
;
return
true
;
...
...
@@ -166,7 +166,7 @@ bool RegularArea<NormalizedShape, Shape>::isNull() const
}
template
<
class
NormalizedShape
,
class
Shape
>
bool
RegularArea
<
NormalizedShape
,
Shape
>::
intersects
(
const
NormalizedShape
*
rect
)
const
bool
RegularArea
<
NormalizedShape
,
Shape
>::
intersects
(
const
NormalizedShape
rect
)
const
{
if
(
!
this
)
return
false
;
...
...
@@ -174,7 +174,7 @@ bool RegularArea<NormalizedShape, Shape>::intersects (const NormalizedShape *rec
if
(
this
->
isEmpty
())
return
false
;
foreach
(
const
NormalizedShape
*
ns
,
this
)
foreach
(
const
NormalizedShape
ns
,
*
this
)
{
if
(
!
(
ns
->
isNull
())
&&
ns
->
intersects
(
rect
))
return
true
;
...
...
@@ -233,7 +233,7 @@ bool RegularArea<NormalizedShape, Shape>::contains (double x, double y) const
}
template
<
class
NormalizedShape
,
class
Shape
>
bool
RegularArea
<
NormalizedShape
,
Shape
>::
contains
(
NormalizedShape
*
shape
)
const
bool
RegularArea
<
NormalizedShape
,
Shape
>::
contains
(
NormalizedShape
shape
)
const
{
if
(
!
this
)
return
false
;
...
...
@@ -265,7 +265,7 @@ RegularArea<NormalizedShape, Shape>::geometry( int xScale, int yScale, int dx, i
return
ret
;
}
typedef
RegularArea
<
NormalizedRect
,
QRect
>
RegularAreaRect
;
typedef
RegularArea
<
NormalizedRect
*
,
QRect
>
RegularAreaRect
;
class
HighlightAreaRect
:
public
RegularAreaRect
{
...
...
core/document.cpp
View file @
178bab06
...
...
@@ -23,7 +23,7 @@
#include <klocale.h>
#include <kfinddialog.h>
#include <kmessagebox.h>
#include <k
appli
cation.h>
#include <k
toolinvo
cation.h>
#include <kuserprofile.h>
#include <krun.h>
#include <kstandarddirs.h>
...
...
@@ -697,7 +697,7 @@ void KPDFDocument::setViewport( const DocumentViewport & viewport, int excludeId
d
->
viewportHistory
.
pop_front
();
// add the item at the end of the queue
d
->
viewportIterator
=
d
->
viewportHistory
.
app
end
(
viewport
);
d
->
viewportIterator
=
d
->
viewportHistory
.
insert
(
d
->
viewportHistory
.
end
(
),
viewport
);
}
// notify change to all other (different from id) observers
...
...
@@ -1190,7 +1190,7 @@ void KPDFDocument::processLink( const KPDFLink * link )
const
KPDFLinkBrowse
*
browse
=
static_cast
<
const
KPDFLinkBrowse
*
>
(
link
);
// if the url is a mailto one, invoke mailer
if
(
browse
->
url
().
startsWith
(
"mailto:"
,
false
)
)
kapp
->
invokeMailer
(
browse
->
url
()
);
KToolInvocation
::
invokeMailer
(
browse
->
url
()
);
else
{
QString
url
=
browse
->
url
();
...
...
@@ -1306,7 +1306,7 @@ void KPDFDocument::sendGeneratorRequest()
if
(
generator
->
canGeneratePixmap
(
request
->
async
)
)
{
kWarning
()
<<
"sending request id="
<<
request
->
id
<<
" "
<<
request
->
width
<<
"x"
<<
request
->
height
<<
"@"
<<
request
->
pageNumber
<<
" async == "
<<
request
->
async
<<
endl
;
d
->
pixmapRequestsStack
.
remove
(
request
);
d
->
pixmapRequestsStack
.
remove
All
(
request
);
generator
->
generatePixmap
(
request
);
}
else
...
...
@@ -1499,14 +1499,14 @@ void KPDFDocument::loadDocumentInfo()
if
(
historyElement
.
hasAttribute
(
"viewport"
)
)
{
QString
vpString
=
historyElement
.
attribute
(
"viewport"
);
d
->
viewportIterator
=
d
->
viewportHistory
.
app
end
(
d
->
viewportIterator
=
d
->
viewportHistory
.
insert
(
d
->
viewportHistory
.
end
(
),
DocumentViewport
(
vpString
)
);
}
historyNode
=
historyNode
.
nextSibling
();
}
// consistancy check
if
(
d
->
viewportHistory
.
isEmpty
()
)
d
->
viewportIterator
=
d
->
viewportHistory
.
app
end
(
DocumentViewport
()
);
d
->
viewportIterator
=
d
->
viewportHistory
.
insert
(
d
->
viewportHistory
.
end
(
),
DocumentViewport
()
);
}
infoNode
=
infoNode
.
nextSibling
();
}
...
...
core/generator.cpp
View file @
178bab06
#include <QTextStream>
#include "generator.h"
std
::
os
tream
&
operator
<<
(
std
::
os
tream
&
str
,
const
PixmapRequest
*
req
)
QTextS
tream
&
operator
<<
(
QTextS
tream
&
str
,
const
PixmapRequest
*
req
)
{
QString
s
(
""
);
if
(
req
->
async
)
...
...
core/generator.h
View file @
178bab06
...
...
@@ -165,6 +165,6 @@ struct PixmapRequest
};
std
::
os
tream
&
operator
<<
(
std
::
os
tream
&
str
,
const
PixmapRequest
*
req
);
QTextS
tream
&
operator
<<
(
QTextS
tream
&
str
,
const
PixmapRequest
*
req
);
#endif
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