[vlc-devel] commit: vout event: use var_GetAndSet ( Rémi Denis-Courmont )
git version control
git at videolan.org
Tue Feb 9 20:22:30 CET 2010
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Feb 9 20:09:50 2010 +0200| [57f92bdea6f1bc694c38fa5de3290a3f3b399558] | committer: Rémi Denis-Courmont
vout event: use var_GetAndSet
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=57f92bdea6f1bc694c38fa5de3290a3f3b399558
---
src/video_output/event.h | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/src/video_output/event.h b/src/video_output/event.h
index 74a8a1a..e0d75b8 100644
--- a/src/video_output/event.h
+++ b/src/video_output/event.h
@@ -65,9 +65,7 @@ static inline void vout_SendEventMouseMoved(vout_thread_t *vout, int x, int y)
}
static inline void vout_SendEventMousePressed(vout_thread_t *vout, int button)
{
- int current = var_GetInteger(vout, "mouse-button-down");
- current |= 1 << button;
- var_SetInteger(vout, "mouse-button-down", current);
+ var_OrInteger(vout, "mouse-button-down", 1 << button);
switch (button)
{
@@ -76,8 +74,7 @@ static inline void vout_SendEventMousePressed(vout_thread_t *vout, int button)
var_SetBool(vout->p_libvlc, "intf-popupmenu", false);
break;
case MOUSE_BUTTON_CENTER:
- var_SetBool(vout->p_libvlc, "intf-show",
- !var_GetBool(vout->p_libvlc, "intf-show"));
+ var_ToggleBool(vout->p_libvlc, "intf-show");
break;
case MOUSE_BUTTON_RIGHT:
var_SetBool(vout->p_libvlc, "intf-popupmenu", true);
@@ -86,9 +83,7 @@ static inline void vout_SendEventMousePressed(vout_thread_t *vout, int button)
}
static inline void vout_SendEventMouseReleased(vout_thread_t *vout, int button)
{
- int current = var_GetInteger(vout, "mouse-button-down");
- current &= ~(1 << button);
- var_SetInteger(vout, "mouse-button-down", current);
+ var_NAndInteger(vout, "mouse-button-down", 1 << button);
}
static inline void vout_SendEventMouseDoubleClick(vout_thread_t *vout)
{
More information about the vlc-devel
mailing list