Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
3ea3f9ff
Commit
3ea3f9ff
authored
Feb 05, 2001
by
Damien Lucas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
. Mouse pointer hidden/shown with middle button in SDL output
. Default is shown. . Default in fullscreen is hidden.
parent
3e22bc68
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
12 deletions
+63
-12
plugins/sdl/intf_sdl.c
plugins/sdl/intf_sdl.c
+21
-4
plugins/sdl/vout_sdl.c
plugins/sdl/vout_sdl.c
+42
-8
No files found.
plugins/sdl/intf_sdl.c
View file @
3ea3f9ff
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* intf_sdl.c: SDL interface plugin
* intf_sdl.c: SDL interface plugin
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_sdl.c,v 1.2
4 2001/01/31 03:42:39 sam
Exp $
* $Id: intf_sdl.c,v 1.2
5 2001/02/05 15:50:57 nitrox
Exp $
*
*
* Authors:
* Authors:
*
*
...
@@ -59,8 +59,10 @@ typedef struct vout_sys_s
...
@@ -59,8 +59,10 @@ typedef struct vout_sys_s
SDL_Overlay
*
p_overlay
;
SDL_Overlay
*
p_overlay
;
boolean_t
b_fullscreen
;
boolean_t
b_fullscreen
;
boolean_t
b_overlay
;
boolean_t
b_overlay
;
boolean_t
b_cursor
;
/* 1 if hide 0 else */
boolean_t
b_reopen_display
;
boolean_t
b_reopen_display
;
boolean_t
b_toggle_fullscreen
;
boolean_t
b_toggle_fullscreen
;
boolean_t
b_hide_cursor
;
Uint8
*
p_buffer
[
2
];
Uint8
*
p_buffer
[
2
];
/* Buffers informations */
/* Buffers informations */
}
vout_sys_t
;
}
vout_sys_t
;
...
@@ -71,7 +73,7 @@ void intf_SDL_Keymap( intf_thread_t * p_intf );
...
@@ -71,7 +73,7 @@ void intf_SDL_Keymap( intf_thread_t * p_intf );
void
intf_SDL_Resize
(
intf_thread_t
*
p_intf
,
int
width
,
int
height
);
void
intf_SDL_Resize
(
intf_thread_t
*
p_intf
,
int
width
,
int
height
);
void
intf_SDL_Fullscreen
(
intf_thread_t
*
p_intf
);
void
intf_SDL_Fullscreen
(
intf_thread_t
*
p_intf
);
void
intf_SDL_YUVSwitch
(
intf_thread_t
*
p_intf
);
void
intf_SDL_YUVSwitch
(
intf_thread_t
*
p_intf
);
void
intf_SDL_Hidecursor
(
intf_thread_t
*
p_intf
);
/*****************************************************************************
/*****************************************************************************
* intf_SDLCreate: initialize and create SDL interface
* intf_SDLCreate: initialize and create SDL interface
...
@@ -139,13 +141,12 @@ void intf_SDLManage( intf_thread_t *p_intf )
...
@@ -139,13 +141,12 @@ void intf_SDLManage( intf_thread_t *p_intf )
while
(
SDL_PollEvent
(
&
event
)
)
while
(
SDL_PollEvent
(
&
event
)
)
{
{
i_key
=
event
.
key
.
keysym
.
sym
;
/* forward it */
switch
(
event
.
type
)
{
switch
(
event
.
type
)
{
case
SDL_VIDEORESIZE
:
/* Resizing of window */
case
SDL_VIDEORESIZE
:
/* Resizing of window */
intf_SDL_Resize
(
p_intf
,
event
.
resize
.
w
,
event
.
resize
.
h
);
intf_SDL_Resize
(
p_intf
,
event
.
resize
.
w
,
event
.
resize
.
h
);
break
;
break
;
case
SDL_KEYDOWN
:
/* if a key is pressed */
case
SDL_KEYDOWN
:
/* if a key is pressed */
i_key
=
event
.
key
.
keysym
.
sym
;
/* forward it */
switch
(
i_key
)
{
switch
(
i_key
)
{
/* switch to fullscreen */
/* switch to fullscreen */
case
SDLK_f
:
case
SDLK_f
:
...
@@ -163,6 +164,14 @@ void intf_SDLManage( intf_thread_t *p_intf )
...
@@ -163,6 +164,14 @@ void intf_SDLManage( intf_thread_t *p_intf )
break
;
break
;
}
}
break
;
break
;
case
SDL_MOUSEBUTTONDOWN
:
if
(
event
.
button
.
button
==
SDL_BUTTON_MIDDLE
)
{
intf_SDL_Hidecursor
(
p_intf
);
}
break
;
case
SDL_QUIT
:
case
SDL_QUIT
:
intf_ProcessKey
(
p_intf
,
SDLK_q
);
intf_ProcessKey
(
p_intf
,
SDLK_q
);
break
;
break
;
...
@@ -197,6 +206,14 @@ void intf_SDL_Fullscreen(intf_thread_t * p_intf)
...
@@ -197,6 +206,14 @@ void intf_SDL_Fullscreen(intf_thread_t * p_intf)
vlc_mutex_unlock
(
&
p_intf
->
p_vout
->
change_lock
);
vlc_mutex_unlock
(
&
p_intf
->
p_vout
->
change_lock
);
}
}
void
intf_SDL_Hidecursor
(
intf_thread_t
*
p_intf
)
{
vlc_mutex_lock
(
&
p_intf
->
p_vout
->
change_lock
);
p_intf
->
p_vout
->
p_sys
->
b_cursor
=
1
-
p_intf
->
p_vout
->
p_sys
->
b_cursor
;
p_intf
->
p_vout
->
p_sys
->
b_hide_cursor
=
1
;
vlc_mutex_unlock
(
&
p_intf
->
p_vout
->
change_lock
);
}
void
intf_SDL_Keymap
(
intf_thread_t
*
p_intf
)
void
intf_SDL_Keymap
(
intf_thread_t
*
p_intf
)
{
{
/* p_intf->p_intf_getKey = intf_getKey; */
/* p_intf->p_intf_getKey = intf_getKey; */
...
...
plugins/sdl/vout_sdl.c
View file @
3ea3f9ff
...
@@ -58,8 +58,10 @@ typedef struct vout_sys_s
...
@@ -58,8 +58,10 @@ typedef struct vout_sys_s
SDL_Overlay
*
p_overlay
;
/* overlay device */
SDL_Overlay
*
p_overlay
;
/* overlay device */
boolean_t
b_fullscreen
;
boolean_t
b_fullscreen
;
boolean_t
b_overlay
;
boolean_t
b_overlay
;
boolean_t
b_cursor
;
boolean_t
b_reopen_display
;
boolean_t
b_reopen_display
;
boolean_t
b_toggle_fullscreen
;
boolean_t
b_toggle_fullscreen
;
boolean_t
b_hide_cursor
;
Uint8
*
p_buffer
[
2
];
Uint8
*
p_buffer
[
2
];
/* Buffers informations */
/* Buffers informations */
}
vout_sys_t
;
}
vout_sys_t
;
...
@@ -70,7 +72,7 @@ typedef struct vout_sys_s
...
@@ -70,7 +72,7 @@ typedef struct vout_sys_s
static
int
SDLOpenDisplay
(
vout_thread_t
*
p_vout
);
static
int
SDLOpenDisplay
(
vout_thread_t
*
p_vout
);
static
void
SDLCloseDisplay
(
vout_thread_t
*
p_vout
);
static
void
SDLCloseDisplay
(
vout_thread_t
*
p_vout
);
static
void
SDLToggleFullScreen
(
vout_thread_t
*
p_vout
);
static
void
SDLToggleFullScreen
(
vout_thread_t
*
p_vout
);
static
void
SDLHideCursor
(
vout_thread_t
*
p_vout
);
/*****************************************************************************
/*****************************************************************************
* vout_SDLCreate: allocate SDL video thread output method
* vout_SDLCreate: allocate SDL video thread output method
*****************************************************************************
*****************************************************************************
...
@@ -115,6 +117,8 @@ int vout_SDLCreate( vout_thread_t *p_vout, char *psz_display,
...
@@ -115,6 +117,8 @@ int vout_SDLCreate( vout_thread_t *p_vout, char *psz_display,
p_vout
->
p_sys
->
i_height
=
main_GetIntVariable
(
VOUT_HEIGHT_VAR
,
p_vout
->
p_sys
->
i_height
=
main_GetIntVariable
(
VOUT_HEIGHT_VAR
,
VOUT_HEIGHT_DEFAULT
);
VOUT_HEIGHT_DEFAULT
);
p_vout
->
p_sys
->
b_cursor
=
0
;
// TODO should be done with a main_GetInt..
if
(
SDLOpenDisplay
(
p_vout
)
)
if
(
SDLOpenDisplay
(
p_vout
)
)
{
{
intf_ErrMsg
(
"error: can't initialize SDL library: %s"
,
intf_ErrMsg
(
"error: can't initialize SDL library: %s"
,
...
@@ -123,7 +127,7 @@ int vout_SDLCreate( vout_thread_t *p_vout, char *psz_display,
...
@@ -123,7 +127,7 @@ int vout_SDLCreate( vout_thread_t *p_vout, char *psz_display,
}
}
p_vout
->
p_sys
->
b_toggle_fullscreen
=
0
;
p_vout
->
p_sys
->
b_toggle_fullscreen
=
0
;
p_vout
->
p_sys
->
b_hide_cursor
=
0
;
return
(
0
);
return
(
0
);
}
}
...
@@ -184,6 +188,12 @@ int vout_SDLManage( vout_thread_t *p_vout )
...
@@ -184,6 +188,12 @@ int vout_SDLManage( vout_thread_t *p_vout )
SDLToggleFullScreen
(
p_vout
);
SDLToggleFullScreen
(
p_vout
);
}
}
/* if pointer has to be hidden/shown we do so */
if
(
p_vout
->
p_sys
->
b_hide_cursor
)
{
SDLHideCursor
(
p_vout
);
}
return
(
0
);
return
(
0
);
}
}
...
@@ -342,7 +352,7 @@ static int SDLOpenDisplay( vout_thread_t *p_vout )
...
@@ -342,7 +352,7 @@ static int SDLOpenDisplay( vout_thread_t *p_vout )
SDL_WM_SetCaption
(
VOUT_TITLE
,
VOUT_TITLE
);
SDL_WM_SetCaption
(
VOUT_TITLE
,
VOUT_TITLE
);
SDL_EventState
(
SDL_KEYUP
,
SDL_IGNORE
);
/* ignore keys up */
SDL_EventState
(
SDL_KEYUP
,
SDL_IGNORE
);
/* ignore keys up */
SDL_EventState
(
SDL_MOUSEBUTTONUP
,
SDL_IGNORE
);
if
(
p_vout
->
b_need_render
)
if
(
p_vout
->
b_need_render
)
{
{
p_vout
->
p_sys
->
p_buffer
[
0
]
=
p_vout
->
p_sys
->
p_display
->
pixels
;
p_vout
->
p_sys
->
p_buffer
[
0
]
=
p_vout
->
p_sys
->
p_display
->
pixels
;
...
@@ -422,16 +432,40 @@ static void SDLCloseDisplay( vout_thread_t *p_vout )
...
@@ -422,16 +432,40 @@ static void SDLCloseDisplay( vout_thread_t *p_vout )
* SDLToggleFullScreen: toggle fullscreen
* SDLToggleFullScreen: toggle fullscreen
*****************************************************************************
*****************************************************************************
* This function toggles the fullscreen state of the surface.
* This function toggles the fullscreen state of the surface.
* And - hide the pointer if switching to fullscreen
* - show the pointer if leaving fullscreen state
*****************************************************************************/
*****************************************************************************/
static
void
SDLToggleFullScreen
(
vout_thread_t
*
p_vout
)
static
void
SDLToggleFullScreen
(
vout_thread_t
*
p_vout
)
{
{
SDL_WM_ToggleFullScreen
(
p_vout
->
p_sys
->
p_display
);
SDL_WM_ToggleFullScreen
(
p_vout
->
p_sys
->
p_display
);
if
(
p_vout
->
p_sys
->
b_fullscreen
)
if
(
p_vout
->
p_sys
->
b_fullscreen
)
SDL_ShowCursor
(
0
);
{
p_vout
->
p_sys
->
b_cursor
=
1
;
}
else
else
SDL_ShowCursor
(
1
);
{
p_vout
->
p_sys
->
b_cursor
=
0
;
}
p_vout
->
p_sys
->
b_toggle_fullscreen
=
0
;
p_vout
->
p_sys
->
b_toggle_fullscreen
=
0
;
SDLHideCursor
(
p_vout
);
}
}
/*****************************************************************************
* SDLHideCursor: Hide/Show mouse pointer
*****************************************************************************
* This function hides/shows the mouse pointer inside the main window.
*****************************************************************************/
static
void
SDLHideCursor
(
vout_thread_t
*
p_vout
)
{
if
(
p_vout
->
p_sys
->
b_cursor
==
1
)
{
SDL_ShowCursor
(
0
);
}
else
{
SDL_ShowCursor
(
1
);
}
p_vout
->
p_sys
->
b_hide_cursor
=
0
;
}
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