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
37afb699
Commit
37afb699
authored
Nov 09, 2011
by
Ivan Ilin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'CFFBranch'
parents
0898bc53
61d46015
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
594 additions
and
1280 deletions
+594
-1280
UBCFFSubsetAdaptor.cpp
src/adaptors/UBCFFSubsetAdaptor.cpp
+513
-1179
UBCFFSubsetAdaptor.h
src/adaptors/UBCFFSubsetAdaptor.h
+29
-63
UBGraphicsAudioItem.h
src/domain/UBGraphicsAudioItem.h
+1
-0
UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.cpp
+2
-0
UBGraphicsItemDelegate.h
src/domain/UBGraphicsItemDelegate.h
+10
-8
UBGraphicsPDFItem.h
src/domain/UBGraphicsPDFItem.h
+2
-1
UBGraphicsPixmapItem.h
src/domain/UBGraphicsPixmapItem.h
+5
-2
UBGraphicsProxyWidget.h
src/domain/UBGraphicsProxyWidget.h
+2
-2
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+0
-3
UBGraphicsSvgItem.h
src/domain/UBGraphicsSvgItem.h
+2
-1
UBGraphicsTextItem.cpp
src/domain/UBGraphicsTextItem.cpp
+0
-1
UBGraphicsTextItem.h
src/domain/UBGraphicsTextItem.h
+2
-1
UBGraphicsVideoItem.h
src/domain/UBGraphicsVideoItem.h
+1
-0
UBGraphicsWidgetItem.h
src/domain/UBGraphicsWidgetItem.h
+7
-3
UBGraphicsWidgetItemDelegate.h
src/domain/UBGraphicsWidgetItemDelegate.h
+1
-1
UBItem.h
src/domain/UBItem.h
+14
-11
UBW3CWidget.cpp
src/domain/UBW3CWidget.cpp
+0
-1
UBGraphicsCurtainItem.cpp
src/tools/UBGraphicsCurtainItem.cpp
+0
-1
UBGraphicsCurtainItem.h
src/tools/UBGraphicsCurtainItem.h
+3
-2
No files found.
src/adaptors/UBCFFSubsetAdaptor.cpp
View file @
37afb699
This diff is collapsed.
Click to expand it.
src/adaptors/UBCFFSubsetAdaptor.h
View file @
37afb699
...
@@ -30,17 +30,9 @@ class UBGraphicsPixmapItem;
...
@@ -30,17 +30,9 @@ class UBGraphicsPixmapItem;
class
UBGraphicsItemDelegate
;
class
UBGraphicsItemDelegate
;
class
QTransform
;
class
QTransform
;
class
QPainter
;
class
QPainter
;
class
UBGraphicsItem
;
class
QGraphicsItem
;
struct
IwbExt
{
IwbExt
()
{;}
IwbExt
(
QDomNode
element
)
:
element
(
element
),
extAttr
(
*
(
new
QVector
<
QDomNode
>
()))
{;}
QDomNode
group
;
QDomNode
element
;
QVector
<
QDomNode
>
extAttr
;
QHash
<
QString
,
QString
>
textAttributes
;
operator
bool
()
const
{
return
!
group
.
isNull
()
||
!
element
.
isNull
();}
};
class
UBCFFSubsetAdaptor
class
UBCFFSubsetAdaptor
{
{
...
@@ -52,22 +44,9 @@ public:
...
@@ -52,22 +44,9 @@ public:
private
:
private
:
class
UBCFFSubsetReader
class
UBCFFSubsetReader
{
{
//xml parse states definition
enum
{
NONE
,
IWB
,
SVG
,
PAGESET
,
PAGE
,
TEXTAREA
,
TSPAN
};
public
:
public
:
UBCFFSubsetReader
(
UBDocumentProxy
*
proxy
,
QFile
*
content
);
UBCFFSubsetReader
(
UBDocumentProxy
*
proxy
,
QFile
*
content
);
QXmlStreamReader
mReader
;
UBDocumentProxy
*
mProxy
;
UBDocumentProxy
*
mProxy
;
QString
pwdContent
;
QString
pwdContent
;
...
@@ -79,6 +58,8 @@ private:
...
@@ -79,6 +58,8 @@ private:
QRectF
mCurrentSceneRect
;
QRectF
mCurrentSceneRect
;
QString
mIndent
;
QString
mIndent
;
QRectF
mViewBox
;
QRectF
mViewBox
;
QRectF
mViewPort
;
qreal
mVBTransFactor
;
QPointF
mViewBoxCenter
;
QPointF
mViewBoxCenter
;
QSize
mSize
;
QSize
mSize
;
...
@@ -86,8 +67,8 @@ private:
...
@@ -86,8 +67,8 @@ private:
// to kill
// to kill
QDomDocument
mDOMdoc
;
QDomDocument
mDOMdoc
;
QDomNode
mCurrentDOMElement
;
QDomNode
mCurrentDOMElement
;
QHash
<
QString
,
IwbExt
>
iwbExtPropertie
s
;
QHash
<
QString
,
UBGraphicsItem
*>
persistedItem
s
;
Q
Hash
<
QString
,
UBGraphicsItemDelegate
*>
persistedItems
;
Q
Dir
mTmpFlashDir
;
bool
hashElements
();
bool
hashElements
();
void
addExtentionsToHash
(
QDomElement
*
parent
,
QDomElement
*
topGroup
);
void
addExtentionsToHash
(
QDomElement
*
parent
,
QDomElement
*
topGroup
);
...
@@ -99,6 +80,8 @@ private:
...
@@ -99,6 +80,8 @@ private:
bool
parseSvgPage
(
const
QDomElement
&
parent
);
bool
parseSvgPage
(
const
QDomElement
&
parent
);
bool
parseSvgPageset
(
const
QDomElement
&
parent
);
bool
parseSvgPageset
(
const
QDomElement
&
parent
);
bool
parseSvgElement
(
const
QDomElement
&
parent
);
bool
parseSvgElement
(
const
QDomElement
&
parent
);
bool
parseIwbMeta
(
const
QDomElement
&
element
);
bool
parseSvg
(
const
QDomElement
&
svgSection
);
inline
bool
parseSvgRect
(
const
QDomElement
&
element
);
inline
bool
parseSvgRect
(
const
QDomElement
&
element
);
inline
bool
parseSvgEllipse
(
const
QDomElement
&
element
);
inline
bool
parseSvgEllipse
(
const
QDomElement
&
element
);
...
@@ -107,61 +90,44 @@ private:
...
@@ -107,61 +90,44 @@ private:
inline
bool
parseSvgText
(
const
QDomElement
&
element
);
inline
bool
parseSvgText
(
const
QDomElement
&
element
);
inline
bool
parseSvgTextarea
(
const
QDomElement
&
element
);
inline
bool
parseSvgTextarea
(
const
QDomElement
&
element
);
inline
bool
parseSvgImage
(
const
QDomElement
&
element
);
inline
bool
parseSvgImage
(
const
QDomElement
&
element
);
// inline bool parseSvgTSpan(const QDomElement)
inline
bool
parseSvgFlash
(
const
QDomElement
&
element
);
bool
parseIwbGroup
(
QDomNode
*
element
);
inline
bool
parseSvgAudio
(
const
QDomElement
&
element
);
inline
void
hashSceneItem
(
QDomNode
*
element
,
UBGraphicsItemDelegate
*
item
);
inline
bool
parseSvgVideo
(
const
QDomElement
&
element
);
inline
bool
parseIwbGroup
(
QDomElement
&
parent
);
inline
bool
parseIwbElement
(
QDomElement
&
element
);
inline
void
parseTSpan
(
const
QDomElement
&
parent
,
QPainter
&
painter
,
qreal
&
curX
,
qreal
&
curY
,
qreal
&
width
,
qreal
&
height
,
qreal
&
linespacing
,
QRectF
&
lastDrawnTextBoundingRect
,
qreal
&
fontSize
,
QColor
&
fontColor
,
QString
&
fontFamily
,
QString
&
fontStretch
,
bool
&
italic
,
int
&
fontWeight
,
int
&
textAlign
,
QTransform
&
fontTransform
);
inline
void
hashSceneItem
(
const
QDomElement
&
element
,
UBGraphicsItem
*
item
);
// to kill
// to kill
void
parseTextAttributes
(
const
QDomElement
&
element
,
qreal
&
fontSize
,
QColor
&
fontColor
,
void
parseTextAttributes
(
const
QDomElement
&
element
,
qreal
&
fontSize
,
QColor
&
fontColor
,
QString
&
fontFamily
,
QString
&
fontStretch
,
bool
&
italic
,
QString
&
fontFamily
,
QString
&
fontStretch
,
bool
&
italic
,
int
&
fontWeight
,
int
&
textAlign
,
QTransform
&
fontTransform
);
int
&
fontWeight
,
int
&
textAlign
,
QTransform
&
fontTransform
);
//methods to store current xml parse state
int
PopState
();
void
PushState
(
int
state
);
//elements parsing methods
//elements parsing methods
bool
parseDoc
();
bool
parseDoc
();
bool
parseCurrentElementStart
();
bool
parseCurrentElementCharacters
();
bool
parseCurrentElementEnd
();
bool
parseIwb
();
bool
parseIwbMeta
();
bool
parseSvg
();
bool
parseRect
();
bool
parseEllipse
();
bool
parseTextArea
();
bool
parseText
();
bool
parsePolygon
();
bool
parsePolyline
();
bool
parsePage
();
bool
parsePageSet
();
bool
parseIwbElementRef
();
bool
createNewScene
();
bool
createNewScene
();
bool
persistCurrentScene
();
bool
persistCurrentScene
();
// helper methods
QStack
<
int
>
stateStack
;
// bool getCurElementTransorm(QTransform &transform);
void
repositionSvgItem
(
QGraphicsItem
*
item
,
qreal
width
,
qreal
height
,
int
currentState
;
qreal
x
,
qreal
y
,
bool
useTransform
,
QTransform
&
transform
);
//helper methods
void
experimentalReposition
(
QGraphicsItem
*
item
,
qreal
width
,
qreal
height
,
bool
getCurElementTransorm
(
QTransform
&
transform
);
qreal
x
,
qreal
y
,
void
repositionSvgItem
(
UBGraphicsSvgItem
*
item
,
qreal
width
,
qreal
height
,
qreal
x
,
qreal
y
,
bool
useTransform
,
QTransform
&
transform
);
bool
useTransform
,
QTransform
&
transform
);
void
repositionPixmapItem
(
UBGraphicsPixmapItem
*
item
,
qreal
width
,
qreal
height
,
qreal
x
,
qreal
y
,
bool
useTransform
,
QTransform
&
transform
);
QColor
colorFromString
(
const
QString
&
clrString
);
QColor
colorFromString
(
const
QString
&
clrString
);
QTransform
transformFromString
(
const
QString
trString
);
QTransform
transformFromString
(
const
QString
trString
);
bool
getViewBoxDimenstions
(
const
QString
&
viewBox
);
bool
getViewBoxDimenstions
(
const
QString
&
viewBox
);
QSvgGenerator
*
createSvgGenerator
(
qreal
width
,
qreal
height
);
QSvgGenerator
*
createSvgGenerator
(
qreal
width
,
qreal
height
);
bool
getTempFileName
();
bool
getTempFileName
();
void
parseTextAttributes
(
qreal
&
fontSize
,
QColor
&
fontColor
,
inline
bool
strToBool
(
QString
);
QString
&
fontFamily
,
QString
&
fontStretch
,
bool
&
italic
,
bool
createTempFlashPath
();
int
&
fontWeight
,
int
&
textAlign
,
QTransform
&
fontTransform
);
};
};
};
};
...
...
src/domain/UBGraphicsAudioItem.h
View file @
37afb699
...
@@ -37,6 +37,7 @@ public:
...
@@ -37,6 +37,7 @@ public:
}
}
virtual
UBItem
*
deepCopy
()
const
;
virtual
UBItem
*
deepCopy
()
const
;
virtual
UBGraphicsItemDelegate
*
Delegate
()
const
{
return
mDelegate
;}
private
slots
:
private
slots
:
...
...
src/domain/UBGraphicsItemDelegate.cpp
View file @
37afb699
...
@@ -319,10 +319,12 @@ void UBGraphicsItemDelegate::lock(bool locked)
...
@@ -319,10 +319,12 @@ void UBGraphicsItemDelegate::lock(bool locked)
if
(
locked
)
if
(
locked
)
{
{
mDelegated
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
QVariant
(
true
));
mDelegated
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
QVariant
(
true
));
qDebug
()
<<
"item's data is called for locked"
<<
mDelegated
->
data
(
UBGraphicsItemData
::
ItemLocked
);
}
}
else
else
{
{
mDelegated
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
QVariant
(
false
));
mDelegated
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
QVariant
(
false
));
qDebug
()
<<
"item's data is called for unlocked"
<<
mDelegated
->
data
(
UBGraphicsItemData
::
ItemLocked
);
}
}
mDelegated
->
update
();
mDelegated
->
update
();
...
...
src/domain/UBGraphicsItemDelegate.h
View file @
37afb699
...
@@ -30,7 +30,7 @@ class UBGraphicsWidgetItem;
...
@@ -30,7 +30,7 @@ class UBGraphicsWidgetItem;
class
DelegateButton
:
public
QGraphicsSvgItem
class
DelegateButton
:
public
QGraphicsSvgItem
{
{
Q_OBJECT
;
Q_OBJECT
public
:
public
:
DelegateButton
(
const
QString
&
fileName
,
QGraphicsItem
*
pDelegated
,
QGraphicsItem
*
parent
=
0
)
DelegateButton
(
const
QString
&
fileName
,
QGraphicsItem
*
pDelegated
,
QGraphicsItem
*
parent
=
0
)
...
@@ -90,7 +90,7 @@ class DelegateButton: public QGraphicsSvgItem
...
@@ -90,7 +90,7 @@ class DelegateButton: public QGraphicsSvgItem
class
UBGraphicsItemDelegate
:
public
QObject
class
UBGraphicsItemDelegate
:
public
QObject
{
{
Q_OBJECT
;
Q_OBJECT
public
:
public
:
UBGraphicsItemDelegate
(
QGraphicsItem
*
pDelegated
,
QObject
*
parent
=
0
,
bool
respectRatio
=
true
,
bool
canRotate
=
false
);
UBGraphicsItemDelegate
(
QGraphicsItem
*
pDelegated
,
QObject
*
parent
=
0
,
bool
respectRatio
=
true
,
bool
canRotate
=
false
);
...
@@ -107,6 +107,8 @@ class UBGraphicsItemDelegate : public QObject
...
@@ -107,6 +107,8 @@ class UBGraphicsItemDelegate : public QObject
virtual
QVariant
itemChange
(
QGraphicsItem
::
GraphicsItemChange
change
,
virtual
QVariant
itemChange
(
QGraphicsItem
::
GraphicsItemChange
change
,
const
QVariant
&
value
);
const
QVariant
&
value
);
void
printMessage
(
const
QString
&
mess
)
{
qDebug
()
<<
mess
;}
QGraphicsItem
*
delegated
()
QGraphicsItem
*
delegated
()
{
{
return
mDelegated
;
return
mDelegated
;
...
@@ -129,17 +131,19 @@ class UBGraphicsItemDelegate : public QObject
...
@@ -129,17 +131,19 @@ class UBGraphicsItemDelegate : public QObject
void
setMimeData
(
QMimeData
*
mimeData
);
void
setMimeData
(
QMimeData
*
mimeData
);
signals
:
signals
:
void
showOnDisplayChanged
(
bool
shown
);
void
showOnDisplayChanged
(
bool
shown
);
void
lockChanged
(
bool
locked
);
void
lockChanged
(
bool
locked
);
public
slots
:
public
slots
:
virtual
void
remove
(
bool
canUndo
=
true
);
virtual
void
remove
(
bool
canUndo
=
true
);
void
showMenu
();
void
showMenu
();
virtual
void
showHide
(
bool
show
);
virtual
void
lock
(
bool
lock
);
virtual
void
duplicate
();
protected
:
protected
:
virtual
void
buildButtons
()
{
};
virtual
void
buildButtons
()
{
;}
virtual
void
decorateMenu
(
QMenu
*
menu
);
virtual
void
decorateMenu
(
QMenu
*
menu
);
virtual
void
updateMenuActionState
();
virtual
void
updateMenuActionState
();
...
@@ -164,9 +168,7 @@ class UBGraphicsItemDelegate : public QObject
...
@@ -164,9 +168,7 @@ class UBGraphicsItemDelegate : public QObject
protected
slots
:
protected
slots
:
virtual
void
gotoContentSource
(
bool
checked
);
virtual
void
gotoContentSource
(
bool
checked
);
virtual
void
showHide
(
bool
show
);
virtual
void
lock
(
bool
lock
);
virtual
void
duplicate
();
private
:
private
:
...
...
src/domain/UBGraphicsPDFItem.h
View file @
37afb699
...
@@ -48,6 +48,7 @@ class UBGraphicsPDFItem: public GraphicsPDFItem, public UBItem, public UBGraphic
...
@@ -48,6 +48,7 @@ class UBGraphicsPDFItem: public GraphicsPDFItem, public UBItem, public UBGraphic
virtual
void
remove
();
virtual
void
remove
();
virtual
UBGraphicsPixmapItem
*
toPixmapItem
()
const
;
virtual
UBGraphicsPixmapItem
*
toPixmapItem
()
const
;
virtual
UBGraphicsItemDelegate
*
Delegate
()
const
{
return
mDelegate
;}
protected
:
protected
:
...
@@ -57,7 +58,7 @@ class UBGraphicsPDFItem: public GraphicsPDFItem, public UBItem, public UBGraphic
...
@@ -57,7 +58,7 @@ class UBGraphicsPDFItem: public GraphicsPDFItem, public UBItem, public UBGraphic
virtual
QVariant
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
);
virtual
QVariant
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
);
UBGraphicsItemDelegate
*
mDelegate
;
//
UBGraphicsItemDelegate* mDelegate;
};
};
#endif
/* UBGRAPHICSPDFITEM_H_ */
#endif
/* UBGRAPHICSPDFITEM_H_ */
src/domain/UBGraphicsPixmapItem.h
View file @
37afb699
...
@@ -45,11 +45,13 @@ class UBGraphicsPixmapItem : public QObject, public QGraphicsPixmapItem, public
...
@@ -45,11 +45,13 @@ class UBGraphicsPixmapItem : public QObject, public QGraphicsPixmapItem, public
virtual
void
remove
();
virtual
void
remove
();
Q_PROPERTY
(
qreal
opacity
READ
opacity
WRITE
setOpacity
)
;
Q_PROPERTY
(
qreal
opacity
READ
opacity
WRITE
setOpacity
)
void
setOpacity
(
qreal
op
);
void
setOpacity
(
qreal
op
);
qreal
opacity
()
const
;
qreal
opacity
()
const
;
virtual
UBGraphicsItemDelegate
*
Delegate
()
const
{
return
mDelegate
;}
protected
:
protected
:
virtual
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
...
@@ -60,7 +62,8 @@ protected:
...
@@ -60,7 +62,8 @@ protected:
virtual
QVariant
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
);
virtual
QVariant
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
);
UBGraphicsItemDelegate
*
mDelegate
;
// UBGraphicsItemDelegate* mDelegate;
};
};
...
...
src/domain/UBGraphicsProxyWidget.h
View file @
37afb699
...
@@ -41,7 +41,7 @@ class UBGraphicsProxyWidget: public QGraphicsProxyWidget, public UBItem, public
...
@@ -41,7 +41,7 @@ class UBGraphicsProxyWidget: public QGraphicsProxyWidget, public UBItem, public
virtual
void
remove
();
virtual
void
remove
();
UBGraphicsItemDelegate
*
delegate
()
{
return
mDelegate
;}
virtual
UBGraphicsItemDelegate
*
Delegate
()
const
{
return
mDelegate
;}
protected
:
protected
:
...
@@ -53,7 +53,7 @@ class UBGraphicsProxyWidget: public QGraphicsProxyWidget, public UBItem, public
...
@@ -53,7 +53,7 @@ class UBGraphicsProxyWidget: public QGraphicsProxyWidget, public UBItem, public
virtual
QVariant
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
);
virtual
QVariant
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
);
UBGraphicsItemDelegate
*
mDelegate
;
//
UBGraphicsItemDelegate* mDelegate;
};
};
#endif
/* UBGRAPHICSPROXYWIDGET_H_ */
#endif
/* UBGRAPHICSPROXYWIDGET_H_ */
src/domain/UBGraphicsScene.cpp
View file @
37afb699
...
@@ -139,7 +139,6 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent)
...
@@ -139,7 +139,6 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent)
connect
(
this
,
SIGNAL
(
selectionChanged
()),
this
,
SLOT
(
selectionChangedProcessing
()));
connect
(
this
,
SIGNAL
(
selectionChanged
()),
this
,
SLOT
(
selectionChangedProcessing
()));
}
}
UBGraphicsScene
::~
UBGraphicsScene
()
UBGraphicsScene
::~
UBGraphicsScene
()
{
{
// NOOP
// NOOP
...
@@ -165,8 +164,6 @@ void UBGraphicsScene::selectionChangedProcessing()
...
@@ -165,8 +164,6 @@ void UBGraphicsScene::selectionChangedProcessing()
nextItem
->
setZValue
(
2
);
nextItem
->
setZValue
(
2
);
qDebug
()
<<
QString
(
" >>> %1 <<< "
).
arg
(
i
)
<<
QString
(
" >>> %1 <<< "
).
arg
(
zValue
);
qDebug
()
<<
QString
(
" >>> %1 <<< "
).
arg
(
i
)
<<
QString
(
" >>> %1 <<< "
).
arg
(
zValue
);
}
}
}
}
// MARK: -
// MARK: -
...
...
src/domain/UBGraphicsSvgItem.h
View file @
37afb699
...
@@ -59,6 +59,7 @@ class UBGraphicsSvgItem: public QGraphicsSvgItem, public UBItem, public UBGraphi
...
@@ -59,6 +59,7 @@ class UBGraphicsSvgItem: public QGraphicsSvgItem, public UBItem, public UBGraphi
virtual
void
remove
();
virtual
void
remove
();
virtual
UBGraphicsPixmapItem
*
toPixmapItem
()
const
;
virtual
UBGraphicsPixmapItem
*
toPixmapItem
()
const
;
virtual
UBGraphicsItemDelegate
*
Delegate
()
const
{
return
mDelegate
;}
protected
:
protected
:
...
@@ -70,7 +71,7 @@ class UBGraphicsSvgItem: public QGraphicsSvgItem, public UBItem, public UBGraphi
...
@@ -70,7 +71,7 @@ class UBGraphicsSvgItem: public QGraphicsSvgItem, public UBItem, public UBGraphi
virtual
QVariant
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
);
virtual
QVariant
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
);
UBGraphicsItemDelegate
*
mDelegate
;
//
UBGraphicsItemDelegate* mDelegate;
QByteArray
mFileData
;
QByteArray
mFileData
;
};
};
...
...
src/domain/UBGraphicsTextItem.cpp
View file @
37afb699
...
@@ -30,7 +30,6 @@ QColor UBGraphicsTextItem::lastUsedTextColor;
...
@@ -30,7 +30,6 @@ QColor UBGraphicsTextItem::lastUsedTextColor;
UBGraphicsTextItem
::
UBGraphicsTextItem
(
QGraphicsItem
*
parent
)
UBGraphicsTextItem
::
UBGraphicsTextItem
(
QGraphicsItem
*
parent
)
:
QGraphicsTextItem
(
parent
)
:
QGraphicsTextItem
(
parent
)
,
mDelegate
(
0
)
,
mMultiClickState
(
0
)
,
mMultiClickState
(
0
)
,
mLastMousePressTime
(
QTime
::
currentTime
())
,
mLastMousePressTime
(
QTime
::
currentTime
())
{
{
...
...
src/domain/UBGraphicsTextItem.h
View file @
37afb699
...
@@ -78,6 +78,7 @@ class UBGraphicsTextItem : public QGraphicsTextItem, public UBItem, public UBRes
...
@@ -78,6 +78,7 @@ class UBGraphicsTextItem : public QGraphicsTextItem, public UBItem, public UBRes
{
{
mColorOnLightBackground
=
pColorOnLightBackground
;
mColorOnLightBackground
=
pColorOnLightBackground
;
}
}
virtual
UBGraphicsItemDelegate
*
Delegate
()
const
{
return
mDelegate
;}
signals
:
signals
:
void
textUndoCommandAdded
(
UBGraphicsTextItem
*
textItem
);
void
textUndoCommandAdded
(
UBGraphicsTextItem
*
textItem
);
...
@@ -96,7 +97,7 @@ class UBGraphicsTextItem : public QGraphicsTextItem, public UBItem, public UBRes
...
@@ -96,7 +97,7 @@ class UBGraphicsTextItem : public QGraphicsTextItem, public UBItem, public UBRes
virtual
QVariant
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
);
virtual
QVariant
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
);
private
:
private
:
UBGraphicsItemDelegate
*
mDelegate
;
//
UBGraphicsItemDelegate *mDelegate;
qreal
mTextHeight
;
qreal
mTextHeight
;
int
mMultiClickState
;
int
mMultiClickState
;
...
...
src/domain/UBGraphicsVideoItem.h
View file @
37afb699
...
@@ -40,6 +40,7 @@ public:
...
@@ -40,6 +40,7 @@ public:
{
{
return
mVideoWidget
;
return
mVideoWidget
;
}
}
virtual
UBGraphicsItemDelegate
*
Delegate
()
const
{
return
mDelegate
;}
public
slots
:
public
slots
:
...
...
src/domain/UBGraphicsWidgetItem.h
View file @
37afb699
...
@@ -29,10 +29,12 @@ class UBGraphicsScene;
...
@@ -29,10 +29,12 @@ class UBGraphicsScene;
class
UBAbstractWidget
;
class
UBAbstractWidget
;
class
UBW3CWidgetAPI
;
class
UBW3CWidgetAPI
;
class
UBW3CWidgetWebStorageAPI
;
class
UBW3CWidgetWebStorageAPI
;
class
UBGraphiscItem
;
class
UBGraphiscItemDelegate
;
class
UBGraphicsWidgetItem
:
public
UBGraphicsProxyWidget
class
UBGraphicsWidgetItem
:
public
UBGraphicsProxyWidget
{
{
Q_OBJECT
;
Q_OBJECT
public
:
public
:
UBGraphicsWidgetItem
(
QGraphicsItem
*
parent
=
0
,
int
widgetType
=
0
);
UBGraphicsWidgetItem
(
QGraphicsItem
*
parent
=
0
,
int
widgetType
=
0
);
...
@@ -60,11 +62,13 @@ class UBGraphicsWidgetItem : public UBGraphicsProxyWidget
...
@@ -60,11 +62,13 @@ class UBGraphicsWidgetItem : public UBGraphicsProxyWidget
QMap
<
QString
,
QString
>
datastoreEntries
()
const
;
QMap
<
QString
,
QString
>
datastoreEntries
()
const
;
void
removeDatastoreEntry
(
const
QString
&
key
);
void
removeDatastoreEntry
(
const
QString
&
key
);
void
removeAllDatastoreEntries
();
void
removeAllDatastoreEntries
();
virtual
UBGraphicsItemDelegate
*
Delegate
()
const
{
return
mDelegate
;}
virtual
void
remove
();
virtual
void
remove
();
void
removeScript
();
void
removeScript
();
protected
:
protected
:
virtual
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
...
@@ -89,7 +93,7 @@ class UBGraphicsWidgetItem : public UBGraphicsProxyWidget
...
@@ -89,7 +93,7 @@ class UBGraphicsWidgetItem : public UBGraphicsProxyWidget
class
UBGraphicsAppleWidgetItem
:
public
UBGraphicsWidgetItem
class
UBGraphicsAppleWidgetItem
:
public
UBGraphicsWidgetItem
{
{
Q_OBJECT
;
Q_OBJECT
public
:
public
:
UBGraphicsAppleWidgetItem
(
const
QUrl
&
pWidgetUrl
,
QGraphicsItem
*
parent
=
0
);
UBGraphicsAppleWidgetItem
(
const
QUrl
&
pWidgetUrl
,
QGraphicsItem
*
parent
=
0
);
...
@@ -109,7 +113,7 @@ class UBGraphicsAppleWidgetItem : public UBGraphicsWidgetItem
...
@@ -109,7 +113,7 @@ class UBGraphicsAppleWidgetItem : public UBGraphicsWidgetItem
class
UBGraphicsW3CWidgetItem
:
public
UBGraphicsWidgetItem
class
UBGraphicsW3CWidgetItem
:
public
UBGraphicsWidgetItem
{
{
Q_OBJECT
;
Q_OBJECT
public
:
public
:
UBGraphicsW3CWidgetItem
(
const
QUrl
&
pWidgetUrl
,
QGraphicsItem
*
parent
=
0
,
int
widgetType
=
UBGraphicsItemType
::
W3CWidgetItemType
);
UBGraphicsW3CWidgetItem
(
const
QUrl
&
pWidgetUrl
,
QGraphicsItem
*
parent
=
0
,
int
widgetType
=
UBGraphicsItemType
::
W3CWidgetItemType
);
...
...
src/domain/UBGraphicsWidgetItemDelegate.h
View file @
37afb699
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
class
UBGraphicsWidgetItemDelegate
:
public
UBGraphicsItemDelegate
class
UBGraphicsWidgetItemDelegate
:
public
UBGraphicsItemDelegate
{
{
Q_OBJECT
;
Q_OBJECT
public
:
public
:
UBGraphicsWidgetItemDelegate
(
UBGraphicsWidgetItem
*
pDelegated
,
int
widgetType
=
0
);
UBGraphicsWidgetItemDelegate
(
UBGraphicsWidgetItem
*
pDelegated
,
int
widgetType
=
0
);
...
...
src/domain/UBItem.h
View file @
37afb699
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#define UBITEM_H
#define UBITEM_H
#include <QtGui>
#include <QtGui>
#include "domain/UBGraphicsItemDelegate.h"
class
UBGraphicsScene
;
class
UBGraphicsScene
;
...
@@ -84,21 +85,23 @@ class UBItem
...
@@ -84,21 +85,23 @@ class UBItem
class
UBGraphicsItem
class
UBGraphicsItem
{
{
protected
:
protected
:
UBGraphicsItem
()
UBGraphicsItem
()
:
mDelegate
(
0
)
{
{
// NOOP
// NOOP
}
}
UBGraphicsItemDelegate
*
mDelegate
;
virtual
~
UBGraphicsItem
()
virtual
~
UBGraphicsItem
()
{
{
// NOOP
// NOOP
}
}
public
:
public
:
virtual
UBGraphicsItemDelegate
*
Delegate
()
const
=
0
;
virtual
void
remove
()
=
0
;
virtual
void
remove
()
=
0
;
};
};
#endif // UBITEM_H
#endif // UBITEM_H
src/domain/UBW3CWidget.cpp
View file @
37afb699
...
@@ -228,7 +228,6 @@ void UBW3CWidget::javaScriptWindowObjectCleared()
...
@@ -228,7 +228,6 @@ void UBW3CWidget::javaScriptWindowObjectCleared()
void
UBW3CWidget
::
votingSystemError
(
const
QString
&
error
)
void
UBW3CWidget
::
votingSystemError
(
const
QString
&
error
)
{
{
page
()
->
mainFrame
()
->
evaluateJavaScript
(
"if(voting.onerror) { voting.onerror('"
+
error
+
"');}"
);
page
()
->
mainFrame
()
->
evaluateJavaScript
(
"if(voting.onerror) { voting.onerror('"
+
error
+
"');}"
);
}
}
...
...
src/tools/UBGraphicsCurtainItem.cpp
View file @
37afb699
...
@@ -36,7 +36,6 @@ const QColor UBGraphicsCurtainItem::sDarkBackgroundOpaqueControlColor = QColor(6
...
@@ -36,7 +36,6 @@ const QColor UBGraphicsCurtainItem::sDarkBackgroundOpaqueControlColor = QColor(6
UBGraphicsCurtainItem
::
UBGraphicsCurtainItem
(
QGraphicsItem
*
parent
)
UBGraphicsCurtainItem
::
UBGraphicsCurtainItem
(
QGraphicsItem
*
parent
)
:
QGraphicsRectItem
(
parent
)
:
QGraphicsRectItem
(
parent
)
,
mDelegate
(
0
)
{
{
mDelegate
=
new
UBGraphicsCurtainItemDelegate
(
this
,
0
);
mDelegate
=
new
UBGraphicsCurtainItemDelegate
(
this
,
0
);
mDelegate
->
init
();
mDelegate
->
init
();
...
...
src/tools/UBGraphicsCurtainItem.h
View file @
37afb699
...
@@ -28,7 +28,7 @@ class UBGraphicsItemDelegate;
...
@@ -28,7 +28,7 @@ class UBGraphicsItemDelegate;
class
UBGraphicsCurtainItem
:
public
QObject
,
public
QGraphicsRectItem
,
public
UBItem
,
public
UBGraphicsItem
class
UBGraphicsCurtainItem
:
public
QObject
,
public
QGraphicsRectItem
,
public
UBItem
,
public
UBGraphicsItem
{
{
Q_OBJECT
;
Q_OBJECT
public
:
public
:
UBGraphicsCurtainItem
(
QGraphicsItem
*
parent
=
0
);
UBGraphicsCurtainItem
(
QGraphicsItem
*
parent
=
0
);
...
@@ -47,6 +47,7 @@ class UBGraphicsCurtainItem : public QObject, public QGraphicsRectItem, public U
...
@@ -47,6 +47,7 @@ class UBGraphicsCurtainItem : public QObject, public QGraphicsRectItem, public U
//TODO UB 4.x not nice ...
//TODO UB 4.x not nice ...
void
triggerRemovedSignal
();
void
triggerRemovedSignal
();
virtual
UBGraphicsItemDelegate
*
Delegate
()
const
{
return
mDelegate
;}
signals
:
signals
:
...
@@ -65,7 +66,7 @@ class UBGraphicsCurtainItem : public QObject, public QGraphicsRectItem, public U
...
@@ -65,7 +66,7 @@ class UBGraphicsCurtainItem : public QObject, public QGraphicsRectItem, public U
QColor
drawColor
()
const
;
QColor
drawColor
()
const
;
QColor
opaqueControlColor
()
const
;
QColor
opaqueControlColor
()
const
;
UBGraphicsItemDelegate
*
mDelegate
;
//
UBGraphicsItemDelegate* mDelegate;
static
const
QColor
sDrawColor
;
static
const
QColor
sDrawColor
;
static
const
QColor
sDarkBackgroundDrawColor
;
static
const
QColor
sDarkBackgroundDrawColor
;
...
...
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