Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
3c62d02f
Commit
3c62d02f
authored
Mar 08, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dialog_Question: simple thread-safe replacement for intf_UserYesNo
parent
cb41eae4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
0 deletions
+47
-0
include/vlc_dialog.h
include/vlc_dialog.h
+17
-0
src/interface/dialog.c
src/interface/dialog.c
+29
-0
src/libvlccore.sym
src/libvlccore.sym
+1
-0
No files found.
include/vlc_dialog.h
View file @
3c62d02f
...
@@ -79,6 +79,23 @@ VLC_EXPORT( void, dialog_Login, (vlc_object_t *, char **, char **, const char *,
...
@@ -79,6 +79,23 @@ VLC_EXPORT( void, dialog_Login, (vlc_object_t *, char **, char **, const char *,
#define dialog_Login(o, u, p, t, ...) \
#define dialog_Login(o, u, p, t, ...) \
dialog_Login(VLC_OBJECT(o), u, p, t, __VA_ARGS__)
dialog_Login(VLC_OBJECT(o), u, p, t, __VA_ARGS__)
/**
* A question dialog.
*/
typedef
struct
dialog_question_t
{
const
char
*
title
;
const
char
*
message
;
const
char
*
yes
;
const
char
*
no
;
const
char
*
cancel
;
int
answer
;
}
dialog_question_t
;
VLC_EXPORT
(
int
,
dialog_Question
,
(
vlc_object_t
*
,
const
char
*
,
const
char
*
,
const
char
*
,
const
char
*
,
const
char
*
)
);
#define dialog_Question(o, t, m, y, n, c) \
dialog_Question(VLC_OBJECT(o), t, m, y, n, c)
VLC_EXPORT
(
int
,
dialog_Register
,
(
vlc_object_t
*
)
);
VLC_EXPORT
(
int
,
dialog_Register
,
(
vlc_object_t
*
)
);
VLC_EXPORT
(
int
,
dialog_Unregister
,
(
vlc_object_t
*
)
);
VLC_EXPORT
(
int
,
dialog_Unregister
,
(
vlc_object_t
*
)
);
#define dialog_Register(o) dialog_Register(VLC_OBJECT(o))
#define dialog_Register(o) dialog_Register(VLC_OBJECT(o))
...
...
src/interface/dialog.c
View file @
3c62d02f
...
@@ -165,3 +165,32 @@ void dialog_Login (vlc_object_t *obj, char **username, char **password,
...
@@ -165,3 +165,32 @@ void dialog_Login (vlc_object_t *obj, char **username, char **password,
va_end
(
ap
);
va_end
(
ap
);
vlc_object_release
(
provider
);
vlc_object_release
(
provider
);
}
}
#undef dialog_Question
/**
* Asks a total (Yes/No/Cancel) question through the user interface.
* @param obj VLC object emitting the question
* @param title dialog box title
* @param text dialog box text
* @param yes first choice/button text
* @param no second choice/button text
* @param cancel third answer/button text, or NULL if no third option
* @return 0 if the user could not answer the question (e.g. there is no UI),
* 1, 2 resp. 3 if the user pressed the first, second resp. third button.
*/
int
dialog_Question
(
vlc_object_t
*
obj
,
const
char
*
title
,
const
char
*
text
,
const
char
*
yes
,
const
char
*
no
,
const
char
*
cancel
)
{
if
(
obj
->
i_flags
&
OBJECT_FLAGS_NOINTERACT
)
return
0
;
vlc_object_t
*
provider
=
dialog_GetProvider
(
obj
);
if
(
provider
==
NULL
)
return
0
;
dialog_question_t
dialog
=
{
title
,
text
,
yes
,
no
,
cancel
,
0
,
};
var_SetAddress
(
provider
,
"dialog-question"
,
&
dialog
);
vlc_object_release
(
provider
);
return
dialog
.
answer
;
}
src/libvlccore.sym
View file @
3c62d02f
...
@@ -103,6 +103,7 @@ demux_PacketizerDestroy
...
@@ -103,6 +103,7 @@ demux_PacketizerDestroy
demux_PacketizerNew
demux_PacketizerNew
demux_vaControlHelper
demux_vaControlHelper
dialog_Login
dialog_Login
dialog_Question
dialog_Register
dialog_Register
dialog_Unregister
dialog_Unregister
dialog_VFatal
dialog_VFatal
...
...
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