Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
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
videolan
vlc
Commits
91cbdf85
Commit
91cbdf85
authored
Apr 06, 2013
by
Erwan Tulou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skins2: reuse graphics from generic bitmap cache (slider)
parent
3a3c9918
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
21 deletions
+22
-21
modules/gui/skins2/controls/ctrl_slider.cpp
modules/gui/skins2/controls/ctrl_slider.cpp
+16
-17
modules/gui/skins2/controls/ctrl_slider.hpp
modules/gui/skins2/controls/ctrl_slider.hpp
+6
-4
No files found.
modules/gui/skins2/controls/ctrl_slider.cpp
View file @
91cbdf85
...
...
@@ -52,24 +52,17 @@ CtrlSliderCursor::CtrlSliderCursor( intf_thread_t *pIntf,
CtrlGeneric
(
pIntf
,
rHelp
,
pVisible
),
m_fsm
(
pIntf
),
m_rVariable
(
rVariable
),
m_tooltip
(
rTooltip
),
m_width
(
rCurve
.
getWidth
()
),
m_height
(
rCurve
.
getHeight
()
),
m_xPosition
(
0
),
m_yPosition
(
0
),
m_cmdOverDown
(
this
),
m_cmdDownOver
(
this
),
m_cmdOverUp
(
this
),
m_cmdUpOver
(
this
),
m_cmdMove
(
this
),
m_cmdScroll
(
this
),
m_lastCursorRect
(),
m_xOffset
(
0
),
m_yOffset
(
0
),
m_pEvt
(
NULL
),
m_rCurve
(
rCurve
)
m_pEvt
(
NULL
),
m_rCurve
(
rCurve
),
m_pImgUp
(
rBmpUp
.
getGraphics
()
),
m_pImgOver
(
rBmpOver
.
getGraphics
()
),
m_pImgDown
(
rBmpDown
.
getGraphics
()
),
m_pImg
(
m_pImgUp
)
{
// Build the images of the cursor
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
getIntf
()
);
m_pImgUp
=
pOsFactory
->
createOSGraphics
(
rBmpUp
.
getWidth
(),
rBmpUp
.
getHeight
()
);
m_pImgUp
->
drawBitmap
(
rBmpUp
,
0
,
0
);
m_pImgDown
=
pOsFactory
->
createOSGraphics
(
rBmpDown
.
getWidth
(),
rBmpDown
.
getHeight
()
);
m_pImgDown
->
drawBitmap
(
rBmpDown
,
0
,
0
);
m_pImgOver
=
pOsFactory
->
createOSGraphics
(
rBmpOver
.
getWidth
(),
rBmpOver
.
getHeight
()
);
m_pImgOver
->
drawBitmap
(
rBmpOver
,
0
,
0
);
// States
m_fsm
.
addState
(
"up"
);
m_fsm
.
addState
(
"over"
);
...
...
@@ -87,7 +80,6 @@ CtrlSliderCursor::CtrlSliderCursor( intf_thread_t *pIntf,
// Initial state
m_fsm
.
setState
(
"up"
);
m_pImg
=
m_pImgUp
;
// Observe the position variable
m_rVariable
.
addObserver
(
this
);
...
...
@@ -97,9 +89,6 @@ CtrlSliderCursor::CtrlSliderCursor( intf_thread_t *pIntf,
CtrlSliderCursor
::~
CtrlSliderCursor
()
{
m_rVariable
.
delObserver
(
this
);
delete
m_pImgUp
;
delete
m_pImgDown
;
delete
m_pImgOver
;
}
...
...
@@ -191,6 +180,9 @@ void CtrlSliderCursor::CmdOverDown::execute()
-
(
int
)(
tempY
*
factorY
);
m_pParent
->
captureMouse
();
if
(
m_pParent
->
m_pImg
==
m_pParent
->
m_pImgDown
)
return
;
m_pParent
->
m_pImg
=
m_pParent
->
m_pImgDown
;
m_pParent
->
refreshLayout
();
}
...
...
@@ -199,6 +191,9 @@ void CtrlSliderCursor::CmdOverDown::execute()
void
CtrlSliderCursor
::
CmdDownOver
::
execute
()
{
m_pParent
->
releaseMouse
();
if
(
m_pParent
->
m_pImg
==
m_pParent
->
m_pImgUp
)
return
;
m_pParent
->
m_pImg
=
m_pParent
->
m_pImgUp
;
m_pParent
->
refreshLayout
();
}
...
...
@@ -206,6 +201,8 @@ void CtrlSliderCursor::CmdDownOver::execute()
void
CtrlSliderCursor
::
CmdUpOver
::
execute
()
{
if
(
m_pParent
->
m_pImg
==
m_pParent
->
m_pImgOver
)
return
;
m_pParent
->
m_pImg
=
m_pParent
->
m_pImgOver
;
m_pParent
->
refreshLayout
();
}
...
...
@@ -213,6 +210,8 @@ void CtrlSliderCursor::CmdUpOver::execute()
void
CtrlSliderCursor
::
CmdOverUp
::
execute
()
{
if
(
m_pParent
->
m_pImg
==
m_pParent
->
m_pImgUp
)
return
;
m_pParent
->
m_pImg
=
m_pParent
->
m_pImgUp
;
m_pParent
->
refreshLayout
();
}
...
...
modules/gui/skins2/controls/ctrl_slider.hpp
View file @
91cbdf85
...
...
@@ -101,12 +101,14 @@ private:
int
m_xOffset
,
m_yOffset
;
/// The last received event
EvtGeneric
*
m_pEvt
;
/// Images of the cursor in the differents states
OSGraphics
*
m_pImgUp
,
*
m_pImgOver
,
*
m_pImgDown
;
/// Current image
OSGraphics
*
m_pImg
;
/// Bezier curve of the slider
const
Bezier
&
m_rCurve
;
/// Images of the cursor in the different states
const
OSGraphics
*
const
m_pImgUp
;
const
OSGraphics
*
const
m_pImgOver
;
const
OSGraphics
*
const
m_pImgDown
;
/// Current image
const
OSGraphics
*
m_pImg
;
/// Method called when the position variable is modified
virtual
void
onUpdate
(
Subject
<
VarPercent
>
&
rVariable
,
void
*
);
...
...
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