Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
71b6a9d0
Commit
71b6a9d0
authored
Sep 07, 2011
by
shibakaneki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Sankore/Sankore-3.1
parents
7348e3cf
d16520d1
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
255 additions
and
89 deletions
+255
-89
UBCFFSubsetAdaptor.cpp
src/adaptors/UBCFFSubsetAdaptor.cpp
+137
-0
UBCFFSubsetAdaptor.h
src/adaptors/UBCFFSubsetAdaptor.h
+1
-0
UBDesktopAnnotationController.cpp
src/desktop/UBDesktopAnnotationController.cpp
+1
-0
UBGraphicsAudioItem.cpp
src/domain/UBGraphicsAudioItem.cpp
+1
-0
UBGraphicsAudioItemDelegate.cpp
src/domain/UBGraphicsAudioItemDelegate.cpp
+1
-0
UBGraphicsMediaItem.cpp
src/domain/UBGraphicsMediaItem.cpp
+1
-0
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+0
-1
UBGraphicsVideoItem.cpp
src/domain/UBGraphicsVideoItem.cpp
+1
-0
UBGraphicsVideoItemDelegate.cpp
src/domain/UBGraphicsVideoItemDelegate.cpp
+0
-1
UBGraphicsWidgetItem.cpp
src/domain/UBGraphicsWidgetItem.cpp
+1
-0
UBGraphicsWidgetItemDelegate.cpp
src/domain/UBGraphicsWidgetItemDelegate.cpp
+0
-1
UBItem.cpp
src/domain/UBItem.cpp
+1
-0
UBActionPalette.cpp
src/gui/UBActionPalette.cpp
+11
-3
UBMagnifer.cpp
src/gui/UBMagnifer.cpp
+85
-83
UBMagnifer.h
src/gui/UBMagnifer.h
+14
-0
No files found.
src/adaptors/UBCFFSubsetAdaptor.cpp
View file @
71b6a9d0
...
@@ -42,6 +42,7 @@ static QString tMeta = "meta";
...
@@ -42,6 +42,7 @@ static QString tMeta = "meta";
static
QString
tPage
=
"page"
;
static
QString
tPage
=
"page"
;
static
QString
tPageset
=
"pageset"
;
static
QString
tPageset
=
"pageset"
;
static
QString
tPolygon
=
"polygon"
;
static
QString
tPolygon
=
"polygon"
;
static
QString
tPolyline
=
"polyline"
;
static
QString
tRect
=
"rect"
;
static
QString
tRect
=
"rect"
;
static
QString
tSvg
=
"svg"
;
static
QString
tSvg
=
"svg"
;
static
QString
tText
=
"text"
;
static
QString
tText
=
"text"
;
...
@@ -70,6 +71,7 @@ static QString aFontstretch = "font-stretch";
...
@@ -70,6 +71,7 @@ static QString aFontstretch = "font-stretch";
static
QString
aFontstyle
=
"font-style"
;
static
QString
aFontstyle
=
"font-style"
;
static
QString
aFontweight
=
"font-weight"
;
static
QString
aFontweight
=
"font-weight"
;
static
QString
aTextalign
=
"text-align"
;
static
QString
aTextalign
=
"text-align"
;
static
QString
aPoints
=
"points"
;
UBCFFSubsetAdaptor
::
UBCFFSubsetAdaptor
()
UBCFFSubsetAdaptor
::
UBCFFSubsetAdaptor
()
...
@@ -229,6 +231,12 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseCurrentElementStart()
...
@@ -229,6 +231,12 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseCurrentElementStart()
return
false
;
return
false
;
}
}
else
else
if
(
elName
==
tPolyline
)
{
if
(
!
parsePolyline
())
return
false
;
}
else
if
(
elName
==
tPage
)
if
(
elName
==
tPage
)
{
{
if
(
!
parsePage
())
if
(
!
parsePage
())
...
@@ -749,6 +757,135 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parsePolygon()
...
@@ -749,6 +757,135 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parsePolygon()
if
(
currentState
==
SVG
&&
mCurrentScene
==
NULL
)
if
(
currentState
==
SVG
&&
mCurrentScene
==
NULL
)
createNewScene
();
createNewScene
();
QStringRef
svgPoints
=
mReader
.
attributes
().
value
(
"points"
);
QPolygonF
polygon
;
if
(
!
svgPoints
.
isNull
())
{
QStringList
ts
=
svgPoints
.
toString
().
split
(
QLatin1Char
(
' '
),
QString
::
SkipEmptyParts
);
foreach
(
const
QString
sPoint
,
ts
)
{
QStringList
sCoord
=
sPoint
.
split
(
QLatin1Char
(
','
),
QString
::
SkipEmptyParts
);
if
(
sCoord
.
size
()
==
2
)
{
QPointF
point
;
point
.
setX
(
sCoord
.
at
(
0
).
toFloat
());
point
.
setY
(
sCoord
.
at
(
1
).
toFloat
());
polygon
<<
point
;
}
else
{
qWarning
()
<<
"cannot make sense of a 'point' value"
<<
sCoord
;
}
}
}
//bounding rect lef top corner coordinates
qreal
x1
=
polygon
.
boundingRect
().
topLeft
().
x
();
qreal
y1
=
polygon
.
boundingRect
().
topLeft
().
y
();
//bounding rect dimensions
qreal
width
=
polygon
.
boundingRect
().
width
();
qreal
height
=
polygon
.
boundingRect
().
height
();
QPen
pen
;
if
(
mReader
.
attributes
().
hasAttribute
(
aStroke
))
pen
.
setColor
(
colorFromString
(
mReader
.
attributes
().
value
(
aStroke
).
toString
()));
if
(
mReader
.
attributes
().
hasAttribute
(
aStrokewidth
))
pen
.
setWidth
(
mReader
.
attributes
().
value
(
aStrokewidth
).
toString
().
toInt
());
QBrush
brush
;
if
(
mReader
.
attributes
().
hasAttribute
(
aFill
))
{
brush
.
setColor
(
colorFromString
(
mReader
.
attributes
().
value
(
aFill
).
toString
()));
brush
.
setStyle
(
Qt
::
SolidPattern
);
}
QSvgGenerator
*
generator
=
createSvgGenerator
(
width
+
pen
.
width
(),
height
+
pen
.
width
());
QPainter
painter
;
painter
.
begin
(
generator
);
//drawing to svg tmp file
painter
.
translate
(
pen
.
widthF
()
/
2
-
x1
,
pen
.
widthF
()
/
2
-
y1
);
painter
.
setBrush
(
brush
);
painter
.
setPen
(
pen
);
painter
.
drawPolygon
(
polygon
);
painter
.
end
();
//add resulting svg file to scene
UBGraphicsSvgItem
*
svgItem
=
mCurrentScene
->
addSvg
(
QUrl
::
fromLocalFile
(
generator
->
fileName
()));
QTransform
transform
;
bool
hastransform
=
getCurElementTransorm
(
transform
);
repositionSvgItem
(
svgItem
,
width
+
10
,
height
+
10
,
x1
-
5
,
y1
-
5
,
hastransform
,
transform
);
delete
generator
;
return
true
;
}
bool
UBCFFSubsetAdaptor
::
UBCFFSubsetReader
::
parsePolyline
()
{
if
(
currentState
!=
SVG
&&
currentState
!=
PAGE
)
{
qWarning
()
<<
"iwb content parse error, unexpected polyline tag at line"
<<
mReader
.
lineNumber
();
return
false
;
}
//create new scene if it's not created yet (for one page document case)
if
(
currentState
==
SVG
&&
mCurrentScene
==
NULL
)
createNewScene
();
QStringRef
svgPoints
=
mReader
.
attributes
().
value
(
"points"
);
QPolygonF
polygon
;
if
(
!
svgPoints
.
isNull
())
{
QStringList
ts
=
svgPoints
.
toString
().
split
(
QLatin1Char
(
' '
),
QString
::
SkipEmptyParts
);
foreach
(
const
QString
sPoint
,
ts
)
{
QStringList
sCoord
=
sPoint
.
split
(
QLatin1Char
(
','
),
QString
::
SkipEmptyParts
);
if
(
sCoord
.
size
()
==
2
)
{
QPointF
point
;
point
.
setX
(
sCoord
.
at
(
0
).
toFloat
());
point
.
setY
(
sCoord
.
at
(
1
).
toFloat
());
polygon
<<
point
;
}
else
{
qWarning
()
<<
"cannot make sense of a 'point' value"
<<
sCoord
;
}
}
polygon
.
translate
(
-
polygon
.
boundingRect
().
topLeft
());
}
//bounding rect lef top corner coordinates
qreal
x1
=
polygon
.
boundingRect
().
topLeft
().
x
();
qreal
y1
=
polygon
.
boundingRect
().
topLeft
().
y
();
//bounding rect dimensions
qreal
width
=
polygon
.
boundingRect
().
width
();
qreal
height
=
polygon
.
boundingRect
().
height
();
QPen
pen
;
if
(
mReader
.
attributes
().
hasAttribute
(
aStroke
))
pen
.
setColor
(
colorFromString
(
mReader
.
attributes
().
value
(
aStroke
).
toString
()));
if
(
mReader
.
attributes
().
hasAttribute
(
aStrokewidth
))
pen
.
setWidth
(
mReader
.
attributes
().
value
(
aStrokewidth
).
toString
().
toInt
());
pen
.
setColor
(
Qt
::
yellow
);
QSvgGenerator
*
generator
=
createSvgGenerator
(
width
+
pen
.
width
(),
height
+
pen
.
width
());
QPainter
painter
;
painter
.
begin
(
generator
);
//drawing to svg tmp file
painter
.
translate
(
pen
.
widthF
()
/
2
,
pen
.
widthF
()
/
2
);
painter
.
setPen
(
pen
);
painter
.
drawPolyline
(
polygon
);
painter
.
end
();
//add resulting svg file to scene
UBGraphicsSvgItem
*
svgItem
=
mCurrentScene
->
addSvg
(
QUrl
::
fromLocalFile
(
generator
->
fileName
()));
QTransform
transform
;
bool
hastransform
=
getCurElementTransorm
(
transform
);
repositionSvgItem
(
svgItem
,
width
+
10
,
height
+
10
,
x1
-
5
,
y1
-
5
,
hastransform
,
transform
);
delete
generator
;
return
true
;
return
true
;
}
}
...
...
src/adaptors/UBCFFSubsetAdaptor.h
View file @
71b6a9d0
...
@@ -84,6 +84,7 @@ private:
...
@@ -84,6 +84,7 @@ private:
bool
parseTextArea
();
bool
parseTextArea
();
bool
parseText
();
bool
parseText
();
bool
parsePolygon
();
bool
parsePolygon
();
bool
parsePolyline
();
bool
parsePage
();
bool
parsePage
();
bool
parsePageSet
();
bool
parsePageSet
();
bool
parseIwbElementRef
();
bool
parseIwbElementRef
();
...
...
src/desktop/UBDesktopAnnotationController.cpp
View file @
71b6a9d0
...
@@ -856,6 +856,7 @@ void UBDesktopAnnotationController::refreshMask()
...
@@ -856,6 +856,7 @@ void UBDesktopAnnotationController::refreshMask()
{
{
if
(
mIsFullyTransparent
if
(
mIsFullyTransparent
||
UBDrawingController
::
drawingController
()
->
stylusTool
()
==
UBStylusTool
::
Selector
||
UBDrawingController
::
drawingController
()
->
stylusTool
()
==
UBStylusTool
::
Selector
//Needed to work correctly when another actions on stylus are checked
||
UBDrawingController
::
drawingController
()
->
stylusTool
()
==
UBStylusTool
::
Eraser
||
UBDrawingController
::
drawingController
()
->
stylusTool
()
==
UBStylusTool
::
Eraser
||
UBDrawingController
::
drawingController
()
->
stylusTool
()
==
UBStylusTool
::
Pointer
||
UBDrawingController
::
drawingController
()
->
stylusTool
()
==
UBStylusTool
::
Pointer
||
UBDrawingController
::
drawingController
()
->
stylusTool
()
==
UBStylusTool
::
Pen
||
UBDrawingController
::
drawingController
()
->
stylusTool
()
==
UBStylusTool
::
Pen
...
...
src/domain/UBGraphicsAudioItem.cpp
View file @
71b6a9d0
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
* You should have received a copy of the GNU General Public License
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#include "UBGraphicsAudioItem.h"
#include "UBGraphicsAudioItem.h"
#include "UBGraphicsAudioItemDelegate.h"
#include "UBGraphicsAudioItemDelegate.h"
#include "UBGraphicsDelegateFrame.h"
#include "UBGraphicsDelegateFrame.h"
...
...
src/domain/UBGraphicsAudioItemDelegate.cpp
View file @
71b6a9d0
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
* You should have received a copy of the GNU General Public License
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#include "UBGraphicsAudioItemDelegate.h"
#include "UBGraphicsAudioItemDelegate.h"
#include "domain/UBGraphicsAudioItem.h"
#include "domain/UBGraphicsAudioItem.h"
#include "domain/UBGraphicsDelegateFrame.h"
#include "domain/UBGraphicsDelegateFrame.h"
...
...
src/domain/UBGraphicsMediaItem.cpp
View file @
71b6a9d0
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
* You should have received a copy of the GNU General Public License
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#include "UBGraphicsMediaItem.h"
#include "UBGraphicsMediaItem.h"
#include "UBGraphicsScene.h"
#include "UBGraphicsScene.h"
#include "UBGraphicsDelegateFrame.h"
#include "UBGraphicsDelegateFrame.h"
...
...
src/domain/UBGraphicsScene.cpp
View file @
71b6a9d0
...
@@ -343,7 +343,6 @@ bool UBGraphicsScene::inputDeviceRelease()
...
@@ -343,7 +343,6 @@ bool UBGraphicsScene::inputDeviceRelease()
}
}
UBDrawingController
*
dc
=
UBDrawingController
::
drawingController
();
UBDrawingController
*
dc
=
UBDrawingController
::
drawingController
();
UBStylusTool
::
Enum
currentTool
=
(
UBStylusTool
::
Enum
)
dc
->
stylusTool
();
if
(
dc
->
isDrawingTool
())
if
(
dc
->
isDrawingTool
())
{
{
mCurrentStroke
=
0
;
mCurrentStroke
=
0
;
...
...
src/domain/UBGraphicsVideoItem.cpp
View file @
71b6a9d0
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
* You should have received a copy of the GNU General Public License
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#include "UBGraphicsVideoItem.h"
#include "UBGraphicsVideoItem.h"
#include "UBGraphicsVideoItemDelegate.h"
#include "UBGraphicsVideoItemDelegate.h"
#include "UBGraphicsDelegateFrame.h"
#include "UBGraphicsDelegateFrame.h"
...
...
src/domain/UBGraphicsVideoItemDelegate.cpp
View file @
71b6a9d0
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#include <QtGui>
#include <QtGui>
#include <QtSvg>
#include <QtSvg>
...
...
src/domain/UBGraphicsWidgetItem.cpp
View file @
71b6a9d0
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
* You should have received a copy of the GNU General Public License
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#include "UBGraphicsWidgetItem.h"
#include "UBGraphicsWidgetItem.h"
#include "api/UBWidgetUniboardAPI.h"
#include "api/UBWidgetUniboardAPI.h"
...
...
src/domain/UBGraphicsWidgetItemDelegate.cpp
View file @
71b6a9d0
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#include <QtGui>
#include <QtGui>
#include <QtSvg>
#include <QtSvg>
...
...
src/domain/UBItem.cpp
View file @
71b6a9d0
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
* You should have received a copy of the GNU General Public License
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#include "UBItem.h"
#include "UBItem.h"
#include "core/memcheck.h"
#include "core/memcheck.h"
...
...
src/gui/UBActionPalette.cpp
View file @
71b6a9d0
/*
/*
* UBActionPalette.cpp
* 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 3 of the License, or
* (at your option) any later version.
*
*
* Created on: 8 oct. 2009
* This program is distributed in the hope that it will be useful,
* Author: Luc
* 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, see <http://www.gnu.org/licenses/>.
*/
*/
#include "UBActionPalette.h"
#include "UBActionPalette.h"
...
...
src/gui/UBMagnifer.cpp
View file @
71b6a9d0
/*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#include <QtGui>
#include <QtGui>
#include "UBMagnifer.h"
#include "UBMagnifer.h"
...
@@ -7,25 +20,15 @@
...
@@ -7,25 +20,15 @@
#include "board/UBBoardController.h"
#include "board/UBBoardController.h"
#include "domain/UBGraphicsScene.h"
#include "domain/UBGraphicsScene.h"
// #include <QPainter>
// #include <QPixmap>
// #include <QDebug>
// #include <QWidget>
// #include <QGraphicsView>
// #include <QTimerEvent>
// #include <QBitmap>
// #include <QPen>
UBMagnifier
::
UBMagnifier
(
QWidget
*
parent
,
bool
isInteractive
)
UBMagnifier
::
UBMagnifier
(
QWidget
*
parent
,
bool
isInteractive
)
:
QWidget
(
parent
,
parent
?
Qt
::
Widget
:
Qt
::
Tool
|
(
Qt
::
FramelessWindowHint
|
Qt
::
WindowStaysOnTopHint
|
Qt
::
X11BypassWindowManagerHint
))
:
QWidget
(
parent
,
parent
?
Qt
::
Widget
:
Qt
::
Tool
|
(
Qt
::
FramelessWindowHint
|
Qt
::
WindowStaysOnTopHint
|
Qt
::
X11BypassWindowManagerHint
))
,
gView
(
0
)
,
mView
(
0
)
,
inTimer
(
false
)
,
borderPen
(
Qt
::
darkGray
)
,
mShouldMoveWidget
(
false
)
,
mShouldMoveWidget
(
false
)
,
mShouldResizeWidget
(
false
)
,
mShouldResizeWidget
(
false
)
,
inTimer
(
false
)
,
borderPen
(
Qt
::
darkGray
)
,
gView
(
0
)
,
mView
(
0
)
{
{
isCusrsorAlreadyStored
=
false
;
isCusrsorAlreadyStored
=
false
;
setMouseTracking
(
true
);
setMouseTracking
(
true
);
...
@@ -134,10 +137,9 @@ void UBMagnifier::setZoom(qreal zoom)
...
@@ -134,10 +137,9 @@ void UBMagnifier::setZoom(qreal zoom)
void
UBMagnifier
::
paintEvent
(
QPaintEvent
*
event
)
void
UBMagnifier
::
paintEvent
(
QPaintEvent
*
event
)
{
{
Q_UNUSED
(
event
);
QPainter
painter
(
this
);
QPainter
painter
(
this
);
// painter.drawRect(0,0,size().width()-1, size().height()-1);
painter
.
setRenderHint
(
QPainter
::
Antialiasing
);
painter
.
setRenderHint
(
QPainter
::
Antialiasing
);
painter
.
setPen
(
Qt
::
NoPen
);
painter
.
setPen
(
Qt
::
NoPen
);
...
...
src/gui/UBMagnifer.h
View file @
71b6a9d0
/*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef UBMAGNIFIER_H
#ifndef UBMAGNIFIER_H
#define UBMAGNIFIER_H
#define UBMAGNIFIER_H
...
...
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