Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Steve Lhomme
VLC
Commits
eb176036
Commit
eb176036
authored
Aug 15, 2005
by
Cyril Deguet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* all: replaced remaining C callbacks by commands
parent
a3eb8858
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
284 additions
and
305 deletions
+284
-305
modules/gui/skins2/commands/async_queue.cpp
modules/gui/skins2/commands/async_queue.cpp
+5
-5
modules/gui/skins2/commands/async_queue.hpp
modules/gui/skins2/commands/async_queue.hpp
+2
-2
modules/gui/skins2/commands/cmd_generic.hpp
modules/gui/skins2/commands/cmd_generic.hpp
+17
-0
modules/gui/skins2/controls/ctrl_button.cpp
modules/gui/skins2/controls/ctrl_button.cpp
+33
-33
modules/gui/skins2/controls/ctrl_checkbox.cpp
modules/gui/skins2/controls/ctrl_checkbox.cpp
+33
-33
modules/gui/skins2/controls/ctrl_generic.hpp
modules/gui/skins2/controls/ctrl_generic.hpp
+0
-17
modules/gui/skins2/controls/ctrl_move.cpp
modules/gui/skins2/controls/ctrl_move.cpp
+16
-16
modules/gui/skins2/controls/ctrl_radialslider.cpp
modules/gui/skins2/controls/ctrl_radialslider.cpp
+8
-8
modules/gui/skins2/controls/ctrl_resize.cpp
modules/gui/skins2/controls/ctrl_resize.cpp
+32
-32
modules/gui/skins2/controls/ctrl_slider.cpp
modules/gui/skins2/controls/ctrl_slider.cpp
+56
-56
modules/gui/skins2/controls/ctrl_text.cpp
modules/gui/skins2/controls/ctrl_text.cpp
+29
-31
modules/gui/skins2/controls/ctrl_text.hpp
modules/gui/skins2/controls/ctrl_text.hpp
+1
-1
modules/gui/skins2/src/os_factory.hpp
modules/gui/skins2/src/os_factory.hpp
+3
-2
modules/gui/skins2/src/skin_common.hpp
modules/gui/skins2/src/skin_common.hpp
+0
-22
modules/gui/skins2/src/tooltip.cpp
modules/gui/skins2/src/tooltip.cpp
+12
-14
modules/gui/skins2/src/tooltip.hpp
modules/gui/skins2/src/tooltip.hpp
+3
-2
modules/gui/skins2/src/vlcproc.cpp
modules/gui/skins2/src/vlcproc.cpp
+6
-5
modules/gui/skins2/src/vlcproc.hpp
modules/gui/skins2/src/vlcproc.hpp
+4
-4
modules/gui/skins2/win32/win32_factory.cpp
modules/gui/skins2/win32/win32_factory.cpp
+2
-2
modules/gui/skins2/win32/win32_factory.hpp
modules/gui/skins2/win32/win32_factory.hpp
+2
-2
modules/gui/skins2/win32/win32_timer.cpp
modules/gui/skins2/win32/win32_timer.cpp
+4
-4
modules/gui/skins2/win32/win32_timer.hpp
modules/gui/skins2/win32/win32_timer.hpp
+4
-4
modules/gui/skins2/x11/x11_factory.cpp
modules/gui/skins2/x11/x11_factory.cpp
+2
-2
modules/gui/skins2/x11/x11_factory.hpp
modules/gui/skins2/x11/x11_factory.hpp
+2
-2
modules/gui/skins2/x11/x11_timer.cpp
modules/gui/skins2/x11/x11_timer.cpp
+4
-3
modules/gui/skins2/x11/x11_timer.hpp
modules/gui/skins2/x11/x11_timer.hpp
+4
-3
No files found.
modules/gui/skins2/commands/async_queue.cpp
View file @
eb176036
...
...
@@ -27,14 +27,15 @@
#include "../src/os_timer.hpp"
AsyncQueue
::
AsyncQueue
(
intf_thread_t
*
pIntf
)
:
SkinObject
(
pIntf
)
AsyncQueue
::
AsyncQueue
(
intf_thread_t
*
pIntf
)
:
SkinObject
(
pIntf
),
m_cmdFlush
(
this
)
{
// Initialize the mutex
vlc_mutex_init
(
pIntf
,
&
m_lock
);
// Create a timer
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
pIntf
);
m_pTimer
=
pOsFactory
->
createOSTimer
(
Callback
(
this
,
&
do
Flush
)
);
m_pTimer
=
pOsFactory
->
createOSTimer
(
m_cmd
Flush
);
// Flush the queue every 10 ms
m_pTimer
->
start
(
10
,
false
);
...
...
@@ -129,9 +130,8 @@ void AsyncQueue::flush()
}
void
AsyncQueue
::
d
o
Flush
(
SkinObject
*
pObj
)
void
AsyncQueue
::
Cm
dFlush
::
execute
(
)
{
AsyncQueue
*
pThis
=
(
AsyncQueue
*
)
pObj
;
// Flush the queue
pThis
->
flush
();
m_pParent
->
flush
();
}
modules/gui/skins2/commands/async_queue.hpp
View file @
eb176036
...
...
@@ -65,8 +65,8 @@ class AsyncQueue: public SkinObject
AsyncQueue
(
intf_thread_t
*
pIntf
);
virtual
~
AsyncQueue
();
//
/
Callback
for the timer
static
void
doFlush
(
SkinObject
*
pObj
);
// Callback
to flush the queue
DEFINE_CALLBACK
(
AsyncQueue
,
Flush
);
};
...
...
modules/gui/skins2/commands/cmd_generic.hpp
View file @
eb176036
...
...
@@ -44,6 +44,23 @@ class Cmd##name: public CmdGeneric \
};
/// Macro to define a "callback" command inside a class
#define DEFINE_CALLBACK( parent, action ) \
class Cmd##action: public CmdGeneric \
{ \
public: \
Cmd##action( parent *pParent ): \
CmdGeneric( pParent->getIntf() ), m_pParent( pParent ) {} \
virtual ~Cmd##action() {} \
virtual void execute(); \
virtual string getType() const { return "Cmd" #parent #action; } \
private: \
parent *m_pParent; \
\
} m_cmd##action; \
friend class Cmd##action;
/// Base class for skins commands
class
CmdGeneric
:
public
SkinObject
{
...
...
modules/gui/skins2/controls/ctrl_button.cpp
View file @
eb176036
...
...
@@ -37,11 +37,11 @@ CtrlButton::CtrlButton( intf_thread_t *pIntf, const GenericBitmap &rBmpUp,
VarBool
*
pVisible
)
:
CtrlGeneric
(
pIntf
,
rHelp
,
pVisible
),
m_fsm
(
pIntf
),
m_rCommand
(
rCommand
),
m_tooltip
(
rTooltip
),
m_cmdUpOverDownOver
(
pIntf
,
this
),
m_cmdDownOverUpOver
(
pIntf
,
this
),
m_cmdDownOverDown
(
pIntf
,
this
),
m_cmdDownDownOver
(
pIntf
,
this
),
m_cmdUpOverUp
(
pIntf
,
this
),
m_cmdUpUpOver
(
pIntf
,
this
),
m_cmdDownUp
(
pIntf
,
this
),
m_cmdUpHidden
(
pIntf
,
this
),
m_cmdHiddenUp
(
pIntf
,
this
)
m_cmdUpOverDownOver
(
this
),
m_cmdDownOverUpOver
(
this
),
m_cmdDownOverDown
(
this
),
m_cmdDownDownOver
(
this
),
m_cmdUpOverUp
(
this
),
m_cmdUpUpOver
(
this
),
m_cmdDownUp
(
this
),
m_cmdUpHidden
(
this
),
m_cmdHiddenUp
(
this
)
{
// Build the images of the button
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
pIntf
);
...
...
@@ -127,74 +127,74 @@ void CtrlButton::draw( OSGraphics &rImage, int xDest, int yDest )
void
CtrlButton
::
CmdUpOverDownOver
::
execute
()
{
m_p
Control
->
captureMouse
();
const
OSGraphics
*
pOldImg
=
m_p
Control
->
m_pImg
;
m_p
Control
->
m_pImg
=
m_p
Control
->
m_pImgDown
;
m_p
Control
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Control
->
m_pImg
);
m_p
Parent
->
captureMouse
();
const
OSGraphics
*
pOldImg
=
m_p
Parent
->
m_pImg
;
m_p
Parent
->
m_pImg
=
m_p
Parent
->
m_pImgDown
;
m_p
Parent
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Parent
->
m_pImg
);
}
void
CtrlButton
::
CmdDownOverUpOver
::
execute
()
{
m_p
Control
->
releaseMouse
();
const
OSGraphics
*
pOldImg
=
m_p
Control
->
m_pImg
;
m_p
Control
->
m_pImg
=
m_p
Control
->
m_pImgUp
;
m_p
Control
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Control
->
m_pImg
);
m_p
Parent
->
releaseMouse
();
const
OSGraphics
*
pOldImg
=
m_p
Parent
->
m_pImg
;
m_p
Parent
->
m_pImg
=
m_p
Parent
->
m_pImgUp
;
m_p
Parent
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Parent
->
m_pImg
);
// Execute the command associated to this button
m_p
Control
->
m_rCommand
.
execute
();
m_p
Parent
->
m_rCommand
.
execute
();
}
void
CtrlButton
::
CmdDownOverDown
::
execute
()
{
const
OSGraphics
*
pOldImg
=
m_p
Control
->
m_pImg
;
m_p
Control
->
m_pImg
=
m_p
Control
->
m_pImgUp
;
m_p
Control
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Control
->
m_pImg
);
const
OSGraphics
*
pOldImg
=
m_p
Parent
->
m_pImg
;
m_p
Parent
->
m_pImg
=
m_p
Parent
->
m_pImgUp
;
m_p
Parent
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Parent
->
m_pImg
);
}
void
CtrlButton
::
CmdDownDownOver
::
execute
()
{
const
OSGraphics
*
pOldImg
=
m_p
Control
->
m_pImg
;
m_p
Control
->
m_pImg
=
m_p
Control
->
m_pImgDown
;
m_p
Control
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Control
->
m_pImg
);
const
OSGraphics
*
pOldImg
=
m_p
Parent
->
m_pImg
;
m_p
Parent
->
m_pImg
=
m_p
Parent
->
m_pImgDown
;
m_p
Parent
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Parent
->
m_pImg
);
}
void
CtrlButton
::
CmdUpUpOver
::
execute
()
{
const
OSGraphics
*
pOldImg
=
m_p
Control
->
m_pImg
;
m_p
Control
->
m_pImg
=
m_p
Control
->
m_pImgOver
;
m_p
Control
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Control
->
m_pImg
);
const
OSGraphics
*
pOldImg
=
m_p
Parent
->
m_pImg
;
m_p
Parent
->
m_pImg
=
m_p
Parent
->
m_pImgOver
;
m_p
Parent
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Parent
->
m_pImg
);
}
void
CtrlButton
::
CmdUpOverUp
::
execute
()
{
const
OSGraphics
*
pOldImg
=
m_p
Control
->
m_pImg
;
m_p
Control
->
m_pImg
=
m_p
Control
->
m_pImgUp
;
m_p
Control
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Control
->
m_pImg
);
const
OSGraphics
*
pOldImg
=
m_p
Parent
->
m_pImg
;
m_p
Parent
->
m_pImg
=
m_p
Parent
->
m_pImgUp
;
m_p
Parent
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Parent
->
m_pImg
);
}
void
CtrlButton
::
CmdDownUp
::
execute
()
{
m_p
Control
->
releaseMouse
();
m_p
Parent
->
releaseMouse
();
}
void
CtrlButton
::
CmdUpHidden
::
execute
()
{
const
OSGraphics
*
pOldImg
=
m_p
Control
->
m_pImg
;
m_p
Control
->
m_pImg
=
NULL
;
m_p
Control
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Control
->
m_pImg
);
const
OSGraphics
*
pOldImg
=
m_p
Parent
->
m_pImg
;
m_p
Parent
->
m_pImg
=
NULL
;
m_p
Parent
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Parent
->
m_pImg
);
}
void
CtrlButton
::
CmdHiddenUp
::
execute
()
{
const
OSGraphics
*
pOldImg
=
m_p
Control
->
m_pImg
;
m_p
Control
->
m_pImg
=
m_p
Control
->
m_pImgUp
;
m_p
Control
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Control
->
m_pImg
);
const
OSGraphics
*
pOldImg
=
m_p
Parent
->
m_pImg
;
m_p
Parent
->
m_pImg
=
m_p
Parent
->
m_pImgUp
;
m_p
Parent
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Parent
->
m_pImg
);
}
modules/gui/skins2/controls/ctrl_checkbox.cpp
View file @
eb176036
...
...
@@ -47,11 +47,11 @@ CtrlCheckbox::CtrlCheckbox( intf_thread_t *pIntf,
m_rVariable
(
rVariable
),
m_rCommand1
(
rCommand1
),
m_rCommand2
(
rCommand2
),
m_tooltip1
(
rTooltip1
),
m_tooltip2
(
rTooltip2
),
m_cmdUpOverDownOver
(
pIntf
,
this
),
m_cmdDownOverUpOver
(
pIntf
,
this
),
m_cmdDownOverDown
(
pIntf
,
this
),
m_cmdDownDownOver
(
pIntf
,
this
),
m_cmdUpOverUp
(
pIntf
,
this
),
m_cmdUpUpOver
(
pIntf
,
this
),
m_cmdDownUp
(
pIntf
,
this
),
m_cmdUpHidden
(
pIntf
,
this
),
m_cmdHiddenUp
(
pIntf
,
this
)
m_cmdUpOverDownOver
(
this
),
m_cmdDownOverUpOver
(
this
),
m_cmdDownOverDown
(
this
),
m_cmdDownDownOver
(
this
),
m_cmdUpOverUp
(
this
),
m_cmdUpUpOver
(
this
),
m_cmdDownUp
(
this
),
m_cmdUpHidden
(
this
),
m_cmdHiddenUp
(
this
)
{
// Build the images of the checkbox
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
pIntf
);
...
...
@@ -171,78 +171,78 @@ void CtrlCheckbox::draw( OSGraphics &rImage, int xDest, int yDest )
void
CtrlCheckbox
::
CmdUpOverDownOver
::
execute
()
{
m_p
Control
->
captureMouse
();
const
OSGraphics
*
pOldImg
=
m_p
Control
->
m_pImgCurrent
;
m_p
Control
->
m_pImgCurrent
=
m_p
Control
->
m_pImgDown
;
m_p
Control
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Control
->
m_pImgCurrent
);
m_p
Parent
->
captureMouse
();
const
OSGraphics
*
pOldImg
=
m_p
Parent
->
m_pImgCurrent
;
m_p
Parent
->
m_pImgCurrent
=
m_p
Parent
->
m_pImgDown
;
m_p
Parent
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Parent
->
m_pImgCurrent
);
}
void
CtrlCheckbox
::
CmdDownOverUpOver
::
execute
()
{
m_p
Control
->
releaseMouse
();
m_p
Parent
->
releaseMouse
();
// Invert the state variable
const
OSGraphics
*
pOldImg
=
m_p
Control
->
m_pImgCurrent
;
m_p
Control
->
m_pImgCurrent
=
m_p
Control
->
m_pImgUp
;
m_p
Control
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Control
->
m_pImgCurrent
);
const
OSGraphics
*
pOldImg
=
m_p
Parent
->
m_pImgCurrent
;
m_p
Parent
->
m_pImgCurrent
=
m_p
Parent
->
m_pImgUp
;
m_p
Parent
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Parent
->
m_pImgCurrent
);
// Execute the command
m_p
Control
->
m_pCommand
->
execute
();
m_p
Parent
->
m_pCommand
->
execute
();
}
void
CtrlCheckbox
::
CmdDownOverDown
::
execute
()
{
const
OSGraphics
*
pOldImg
=
m_p
Control
->
m_pImgCurrent
;
m_p
Control
->
m_pImgCurrent
=
m_p
Control
->
m_pImgUp
;
m_p
Control
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Control
->
m_pImgCurrent
);
const
OSGraphics
*
pOldImg
=
m_p
Parent
->
m_pImgCurrent
;
m_p
Parent
->
m_pImgCurrent
=
m_p
Parent
->
m_pImgUp
;
m_p
Parent
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Parent
->
m_pImgCurrent
);
}
void
CtrlCheckbox
::
CmdDownDownOver
::
execute
()
{
const
OSGraphics
*
pOldImg
=
m_p
Control
->
m_pImgCurrent
;
m_p
Control
->
m_pImgCurrent
=
m_p
Control
->
m_pImgDown
;
m_p
Control
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Control
->
m_pImgCurrent
);
const
OSGraphics
*
pOldImg
=
m_p
Parent
->
m_pImgCurrent
;
m_p
Parent
->
m_pImgCurrent
=
m_p
Parent
->
m_pImgDown
;
m_p
Parent
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Parent
->
m_pImgCurrent
);
}
void
CtrlCheckbox
::
CmdUpUpOver
::
execute
()
{
const
OSGraphics
*
pOldImg
=
m_p
Control
->
m_pImgCurrent
;
m_p
Control
->
m_pImgCurrent
=
m_p
Control
->
m_pImgOver
;
m_p
Control
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Control
->
m_pImgCurrent
);
const
OSGraphics
*
pOldImg
=
m_p
Parent
->
m_pImgCurrent
;
m_p
Parent
->
m_pImgCurrent
=
m_p
Parent
->
m_pImgOver
;
m_p
Parent
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Parent
->
m_pImgCurrent
);
}
void
CtrlCheckbox
::
CmdUpOverUp
::
execute
()
{
const
OSGraphics
*
pOldImg
=
m_p
Control
->
m_pImgCurrent
;
m_p
Control
->
m_pImgCurrent
=
m_p
Control
->
m_pImgUp
;
m_p
Control
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Control
->
m_pImgCurrent
);
const
OSGraphics
*
pOldImg
=
m_p
Parent
->
m_pImgCurrent
;
m_p
Parent
->
m_pImgCurrent
=
m_p
Parent
->
m_pImgUp
;
m_p
Parent
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Parent
->
m_pImgCurrent
);
}
void
CtrlCheckbox
::
CmdDownUp
::
execute
()
{
m_p
Control
->
releaseMouse
();
m_p
Parent
->
releaseMouse
();
}
void
CtrlCheckbox
::
CmdUpHidden
::
execute
()
{
const
OSGraphics
*
pOldImg
=
m_p
Control
->
m_pImgCurrent
;
m_p
Control
->
m_pImgCurrent
=
NULL
;
m_p
Control
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Control
->
m_pImgCurrent
);
const
OSGraphics
*
pOldImg
=
m_p
Parent
->
m_pImgCurrent
;
m_p
Parent
->
m_pImgCurrent
=
NULL
;
m_p
Parent
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Parent
->
m_pImgCurrent
);
}
void
CtrlCheckbox
::
CmdHiddenUp
::
execute
()
{
const
OSGraphics
*
pOldImg
=
m_p
Control
->
m_pImgCurrent
;
m_p
Control
->
m_pImgCurrent
=
m_p
Control
->
m_pImgUp
;
m_p
Control
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Control
->
m_pImgCurrent
);
const
OSGraphics
*
pOldImg
=
m_p
Parent
->
m_pImgCurrent
;
m_p
Parent
->
m_pImgCurrent
=
m_p
Parent
->
m_pImgUp
;
m_p
Parent
->
notifyLayoutMaxSize
(
pOldImg
,
m_p
Parent
->
m_pImgCurrent
);
}
...
...
modules/gui/skins2/controls/ctrl_generic.hpp
View file @
eb176036
...
...
@@ -134,21 +134,4 @@ class CtrlGeneric: public SkinObject, public Observer<VarBool>
typedef
CountedPtr
<
CtrlGeneric
>
CtrlGenericPtr
;
// Macro to define a control action command
#define DEFINE_CALLBACK( control, action ) \
class Cmd##action: public CmdGeneric \
{ \
public: \
Cmd##action( intf_thread_t *pIntf, control *pControl ): \
CmdGeneric( pIntf ), m_pControl( pControl) {} \
virtual ~Cmd##action() {} \
virtual void execute(); \
virtual string getType() const { return "Cmd" #control #action; } \
private: \
control *m_pControl; \
\
} m_cmd##action; \
friend class Cmd##action;
#endif
modules/gui/skins2/controls/ctrl_move.cpp
View file @
eb176036
...
...
@@ -37,9 +37,9 @@ CtrlMove::CtrlMove( intf_thread_t *pIntf, WindowManager &rWindowManager,
CtrlFlat
(
pIntf
,
rHelp
,
pVisible
),
m_fsm
(
pIntf
),
m_rWindowManager
(
rWindowManager
),
m_rCtrl
(
rCtrl
),
m_rWindow
(
rWindow
),
m_cmdMovingMoving
(
pIntf
,
this
),
m_cmdStillMoving
(
pIntf
,
this
),
m_cmdMovingStill
(
pIntf
,
this
)
m_cmdMovingMoving
(
this
),
m_cmdStillMoving
(
this
),
m_cmdMovingStill
(
this
)
{
m_pEvt
=
NULL
;
m_xPos
=
0
;
...
...
@@ -98,33 +98,33 @@ void CtrlMove::handleEvent( EvtGeneric &rEvent )
void
CtrlMove
::
CmdStillMoving
::
execute
()
{
EvtMouse
*
pEvtMouse
=
(
EvtMouse
*
)
m_p
Control
->
m_pEvt
;
EvtMouse
*
pEvtMouse
=
(
EvtMouse
*
)
m_p
Parent
->
m_pEvt
;
m_p
Control
->
m_xPos
=
pEvtMouse
->
getXPos
();
m_p
Control
->
m_yPos
=
pEvtMouse
->
getYPos
();
m_p
Parent
->
m_xPos
=
pEvtMouse
->
getXPos
();
m_p
Parent
->
m_yPos
=
pEvtMouse
->
getYPos
();
m_p
Control
->
captureMouse
();
m_p
Parent
->
captureMouse
();
m_p
Control
->
m_rWindowManager
.
startMove
(
m_p
Control
->
m_rWindow
);
m_p
Parent
->
m_rWindowManager
.
startMove
(
m_p
Parent
->
m_rWindow
);
}
void
CtrlMove
::
CmdMovingMoving
::
execute
()
{
EvtMotion
*
pEvtMotion
=
(
EvtMotion
*
)
m_p
Control
->
m_pEvt
;
EvtMotion
*
pEvtMotion
=
(
EvtMotion
*
)
m_p
Parent
->
m_pEvt
;
int
xNewLeft
=
pEvtMotion
->
getXPos
()
-
m_p
Control
->
m_xPos
+
m_p
Control
->
m_rWindow
.
getLeft
();
int
yNewTop
=
pEvtMotion
->
getYPos
()
-
m_p
Control
->
m_yPos
+
m_p
Control
->
m_rWindow
.
getTop
();
int
xNewLeft
=
pEvtMotion
->
getXPos
()
-
m_p
Parent
->
m_xPos
+
m_p
Parent
->
m_rWindow
.
getLeft
();
int
yNewTop
=
pEvtMotion
->
getYPos
()
-
m_p
Parent
->
m_yPos
+
m_p
Parent
->
m_rWindow
.
getTop
();
m_p
Control
->
m_rWindowManager
.
move
(
m_p
Control
->
m_rWindow
,
xNewLeft
,
yNewTop
);
m_p
Parent
->
m_rWindowManager
.
move
(
m_p
Parent
->
m_rWindow
,
xNewLeft
,
yNewTop
);
}
void
CtrlMove
::
CmdMovingStill
::
execute
()
{
m_p
Control
->
releaseMouse
();
m_p
Parent
->
releaseMouse
();
m_p
Control
->
m_rWindowManager
.
stopMove
();
m_p
Parent
->
m_rWindowManager
.
stopMove
();
}
modules/gui/skins2/controls/ctrl_radialslider.cpp
View file @
eb176036
...
...
@@ -40,8 +40,8 @@ CtrlRadialSlider::CtrlRadialSlider( intf_thread_t *pIntf,
VarBool
*
pVisible
)
:
CtrlGeneric
(
pIntf
,
rHelp
,
pVisible
),
m_fsm
(
pIntf
),
m_numImg
(
numImg
),
m_rVariable
(
rVariable
),
m_minAngle
(
minAngle
),
m_maxAngle
(
maxAngle
),
m_cmdUpDown
(
pIntf
,
this
),
m_cmdDownUp
(
pIntf
,
this
),
m_cmdMove
(
pIntf
,
this
)
m_cmdUpDown
(
this
),
m_cmdDownUp
(
this
),
m_cmdMove
(
this
)
{
// Build the images of the sequence
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
getIntf
()
);
...
...
@@ -107,27 +107,27 @@ void CtrlRadialSlider::onUpdate( Subject<VarPercent> &rVariable )
void
CtrlRadialSlider
::
CmdUpDown
::
execute
()
{
EvtMouse
*
pEvtMouse
=
(
EvtMouse
*
)
m_p
Control
->
m_pEvt
;
EvtMouse
*
pEvtMouse
=
(
EvtMouse
*
)
m_p
Parent
->
m_pEvt
;
// Change the position of the cursor, in non-blocking mode
m_p
Control
->
setCursor
(
pEvtMouse
->
getXPos
(),
pEvtMouse
->
getYPos
(),
false
);
m_p
Parent
->
setCursor
(
pEvtMouse
->
getXPos
(),
pEvtMouse
->
getYPos
(),
false
);
m_p
Control
->
captureMouse
();
m_p
Parent
->
captureMouse
();
}
void
CtrlRadialSlider
::
CmdDownUp
::
execute
()
{
m_p
Control
->
releaseMouse
();
m_p
Parent
->
releaseMouse
();
}
void
CtrlRadialSlider
::
CmdMove
::
execute
()
{
EvtMouse
*
pEvtMouse
=
(
EvtMouse
*
)
m_p
Control
->
m_pEvt
;
EvtMouse
*
pEvtMouse
=
(
EvtMouse
*
)
m_p
Parent
->
m_pEvt
;
// Change the position of the cursor, in blocking mode
m_p
Control
->
setCursor
(
pEvtMouse
->
getXPos
(),
pEvtMouse
->
getYPos
(),
true
);
m_p
Parent
->
setCursor
(
pEvtMouse
->
getXPos
(),
pEvtMouse
->
getYPos
(),
true
);
}
...
...
modules/gui/skins2/controls/ctrl_resize.cpp
View file @
eb176036
...
...
@@ -37,12 +37,12 @@ CtrlResize::CtrlResize( intf_thread_t *pIntf, CtrlFlat &rCtrl,
GenericLayout
&
rLayout
,
const
UString
&
rHelp
,
VarBool
*
pVisible
)
:
CtrlFlat
(
pIntf
,
rHelp
,
pVisible
),
m_fsm
(
pIntf
),
m_rCtrl
(
rCtrl
),
m_rLayout
(
rLayout
),
m_cmdOutStill
(
pIntf
,
this
),
m_cmdStillOut
(
pIntf
,
this
),
m_cmdStillStill
(
pIntf
,
this
),
m_cmdStillResize
(
pIntf
,
this
),
m_cmdResizeStill
(
pIntf
,
this
),
m_cmdResizeResize
(
pIntf
,
this
)
m_rLayout
(
rLayout
),
m_cmdOutStill
(
this
),
m_cmdStillOut
(
this
),
m_cmdStillStill
(
this
),
m_cmdStillResize
(
this
),
m_cmdResizeStill
(
this
),
m_cmdResizeResize
(
this
)
{
m_pEvt
=
NULL
;
m_xPos
=
0
;
...
...
@@ -105,87 +105,87 @@ void CtrlResize::handleEvent( EvtGeneric &rEvent )
void
CtrlResize
::
CmdOutStill
::
execute
()
{
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
m_p
Control
->
getIntf
()
);
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
m_p
Parent
->
getIntf
()
);
pOsFactory
->
changeCursor
(
OSFactory
::
kResizeNWSE
);
}
void
CtrlResize
::
CmdStillOut
::
execute
()
{
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
m_p
Control
->
getIntf
()
);
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
m_p
Parent
->
getIntf
()
);
pOsFactory
->
changeCursor
(
OSFactory
::
kDefaultArrow
);
}
void
CtrlResize
::
CmdStillStill
::
execute
()
{
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
m_p
Control
->
getIntf
()
);
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
m_p
Parent
->
getIntf
()
);
pOsFactory
->
changeCursor
(
OSFactory
::
kResizeNWSE
);
}
void
CtrlResize
::
CmdStillResize
::
execute
()
{
EvtMouse
*
pEvtMouse
=
(
EvtMouse
*
)
m_p
Control
->
m_pEvt
;
EvtMouse
*
pEvtMouse
=
(
EvtMouse
*
)
m_p
Parent
->
m_pEvt
;
// Set the cursor
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
m_p
Control
->
getIntf
()
);
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
m_p
Parent
->
getIntf
()
);
pOsFactory
->
changeCursor
(
OSFactory
::
kResizeNWSE
);
m_p
Control
->
m_xPos
=
pEvtMouse
->
getXPos
();
m_p
Control
->
m_yPos
=
pEvtMouse
->
getYPos
();
m_p
Parent
->
m_xPos
=
pEvtMouse
->
getXPos
();
m_p
Parent
->
m_yPos
=
pEvtMouse
->
getYPos
();
m_p
Control
->
captureMouse
();
m_p
Parent
->
captureMouse
();
m_p
Control
->
m_width
=
m_p
Control
->
m_rLayout
.
getWidth
();
m_p
Control
->
m_height
=
m_p
Control
->
m_rLayout
.
getHeight
();
m_p
Parent
->
m_width
=
m_p
Parent
->
m_rLayout
.
getWidth
();
m_p
Parent
->
m_height
=
m_p
Parent
->
m_rLayout
.
getHeight
();
}
void
CtrlResize
::
CmdResizeStill
::
execute
()
{
// Set the cursor
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
m_p
Control
->
getIntf
()
);
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
m_p
Parent
->
getIntf
()
);
pOsFactory
->
changeCursor
(
OSFactory
::
kResizeNWSE
);
m_p
Control
->
releaseMouse
();
m_p
Parent
->
releaseMouse
();
}
void
CtrlResize
::
CmdResizeResize
::
execute
()
{
EvtMotion
*
pEvtMotion
=
(
EvtMotion
*
)
m_p
Control
->
m_pEvt
;
EvtMotion
*
pEvtMotion
=
(
EvtMotion
*
)
m_p
Parent
->
m_pEvt
;
// Set the cursor
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
m_p
Control
->
getIntf
()
);
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
m_p
Parent
->
getIntf
()
);
pOsFactory
->
changeCursor
(
OSFactory
::
kResizeNWSE
);
int
newWidth
=
pEvtMotion
->
getXPos
()
-
m_p
Control
->
m_xPos
+
m_p
Control
->
m_width
;
int
newHeight
=
pEvtMotion
->
getYPos
()
-
m_p
Control
->
m_yPos
+
m_p
Control
->
m_height
;
int
newWidth
=
pEvtMotion
->
getXPos
()
-
m_p
Parent
->
m_xPos
+
m_p
Parent
->
m_width
;
int
newHeight
=
pEvtMotion
->
getYPos
()
-
m_p
Parent
->
m_yPos
+
m_p
Parent
->
m_height
;
// Check boundaries
if
(
newWidth
<
m_p
Control
->
m_rLayout
.
getMinWidth
()
)
if
(
newWidth
<
m_p
Parent
->
m_rLayout
.
getMinWidth
()
)
{
newWidth
=
m_p
Control
->
m_rLayout
.
getMinWidth
();
newWidth
=
m_p
Parent
->
m_rLayout
.
getMinWidth
();
}
if
(
newWidth
>
m_p
Control
->
m_rLayout
.
getMaxWidth
()
)
if
(
newWidth
>
m_p
Parent
->
m_rLayout
.
getMaxWidth
()
)
{
newWidth
=
m_p
Control
->
m_rLayout
.
getMaxWidth
();
newWidth
=
m_p
Parent
->
m_rLayout
.
getMaxWidth
();
}
if
(
newHeight
<
m_p
Control
->
m_rLayout
.
getMinHeight
()
)
if
(
newHeight
<
m_p
Parent
->
m_rLayout
.
getMinHeight
()
)
{
newHeight
=
m_p
Control
->
m_rLayout
.
getMinHeight
();
newHeight
=
m_p
Parent
->
m_rLayout
.
getMinHeight
();
}
if
(
newHeight
>
m_p
Control
->
m_rLayout
.
getMaxHeight
()
)
if
(
newHeight
>
m_p
Parent
->
m_rLayout
.
getMaxHeight
()
)
{
newHeight
=
m_p
Control
->
m_rLayout
.
getMaxHeight
();
newHeight
=
m_p
Parent
->
m_rLayout
.
getMaxHeight
();
}
// Create a resize command
CmdGeneric
*
pCmd
=
new
CmdResize
(
m_p
Control
->
getIntf
(),
m_p
Control
->
m_rLayout
,
CmdGeneric
*
pCmd
=
new
CmdResize
(
m_p
Parent
->
getIntf
(),
m_p
Parent
->
m_rLayout
,
newWidth
,
newHeight
);
// Push the command in the asynchronous command queue
AsyncQueue
*
pQueue
=
AsyncQueue
::
instance
(
m_p
Control
->
getIntf
()
);
AsyncQueue
*
pQueue
=
AsyncQueue
::
instance
(
m_p
Parent
->
getIntf
()
);
pQueue
->
remove
(
"resize"
);
pQueue
->
push
(
CmdGenericPtr
(
pCmd
)
);
}
modules/gui/skins2/controls/ctrl_slider.cpp
View file @
eb176036
...
...
@@ -50,9 +50,9 @@ 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_cmdOverDown
(
pIntf
,
this
),
m_cmdDownOver
(
pIntf
,
this
),
m_cmdOverUp
(
pIntf
,
this
),
m_cmdUpOver
(
pIntf
,
this
),
m_cmdMove
(
pIntf
,
this
),
m_cmdScroll
(
pIntf
,
this
),
m_cmdOverDown
(
this
),
m_cmdDownOver
(
this
),