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
6f0b8197
Commit
6f0b8197
authored
Feb 09, 2010
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More improvements to the hildon interface and make it compilable on non-maemo platforms
parent
caa08dce
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
45 deletions
+70
-45
configure.ac
configure.ac
+7
-1
modules/gui/hildon/maemo.c
modules/gui/hildon/maemo.c
+4
-6
modules/gui/hildon/maemo_callbacks.c
modules/gui/hildon/maemo_callbacks.c
+2
-2
modules/gui/hildon/maemo_input.c
modules/gui/hildon/maemo_input.c
+56
-29
modules/gui/hildon/maemo_input.h
modules/gui/hildon/maemo_input.h
+1
-7
No files found.
configure.ac
View file @
6f0b8197
...
...
@@ -3992,7 +3992,13 @@ dnl
AC_ARG_ENABLE(hildon,
[ --enable-hildon Hildon touchscreen UI (default disabled)])
AS_IF([test "${enable_hildon}" = "yes"], [
PKG_CHECK_MODULES(HILDON, [hildon-1 hildon-fm-2], [
PKG_CHECK_MODULES(HILDON, [hildon-1], [
PKG_CHECK_MODULES(HILDON_FM, hildon-fm-2, [
VLC_ADD_CFLAGS([hildon],[${HILDON_FM_CFLAGS} -IHAVE_HILDON_FM])
VLC_ADD_LIBS([hildon],[${HILDON_FM_LIBS}])
], [
AC_MSG_WARN(hildon-fm-2 not found)
])
VLC_ADD_CFLAGS([hildon],[${HILDON_CFLAGS}])
VLC_ADD_LIBS([hildon],[${HILDON_LIBS}])
VLC_ADD_PLUGIN([hildon])
...
...
modules/gui/hildon/maemo.c
View file @
6f0b8197
...
...
@@ -204,7 +204,6 @@ static void *Thread( void *obj )
play_button
=
gtk_button_new
();
gtk_button_set_image
(
GTK_BUTTON
(
play_button
),
gtk_image_new_from_stock
(
"vlc-play"
,
GTK_ICON_SIZE_BUTTON
)
);
gtk_widget_set_size_request
(
play_button
,
60
,
60
);
p_intf
->
p_sys
->
p_play_button
=
play_button
;
stop_button
=
gtk_button_new
();
gtk_button_set_image
(
GTK_BUTTON
(
stop_button
),
...
...
@@ -222,7 +221,7 @@ static void *Thread( void *obj )
p_intf
->
p_sys
->
p_seekbar
=
HILDON_SEEKBAR
(
seekbar
);
// We add them to the hbox
gtk_box_pack_start
(
GTK_BOX
(
bottom_hbox
),
play_button
,
FALSE
,
FALSE
,
5
);
gtk_box_pack_start
(
GTK_BOX
(
bottom_hbox
),
play_button
,
FALSE
,
FALSE
,
0
);
gtk_box_pack_start
(
GTK_BOX
(
bottom_hbox
),
stop_button
,
FALSE
,
FALSE
,
0
);
gtk_box_pack_start
(
GTK_BOX
(
bottom_hbox
),
prev_button
,
FALSE
,
FALSE
,
0
);
gtk_box_pack_start
(
GTK_BOX
(
bottom_hbox
),
next_button
,
FALSE
,
FALSE
,
0
);
...
...
@@ -260,8 +259,7 @@ static void *Thread( void *obj )
#endif
// Set callback with the vlc core
g_timeout_add
(
INTF_IDLE_SLEEP
/
1000
,
process_events
,
p_intf
);
g_timeout_add
(
150
/* miliseconds */
,
should_die
,
p_intf
);
g_timeout_add
(
1000
/* miliseconds */
,
should_die
,
p_intf
);
var_AddCallback
(
p_intf
->
p_sys
->
p_playlist
,
"item-change"
,
item_changed_cb
,
p_intf
);
var_AddCallback
(
p_intf
->
p_sys
->
p_playlist
,
"item-current"
,
...
...
@@ -377,8 +375,8 @@ static gboolean interface_ready( gpointer data )
p_intf
->
p_sys
->
xid
=
GDK_WINDOW_XID
(
gtk_widget_get_window
(
p_intf
->
p_sys
->
p_video_window
)
);
//
Look if the playlist is already started
item_changed_pl
(
p_intf
);
//
Refresh playlist
post_event
(
p_intf
,
EVENT_PLAYLIST_CURRENT
);
// Everything is initialised
vlc_sem_post
(
&
p_intf
->
p_sys
->
ready
);
...
...
modules/gui/hildon/maemo_callbacks.c
View file @
6f0b8197
...
...
@@ -30,7 +30,7 @@
#include <gdk/gdkkeysyms.h>
#include <vlc_keys.h>
#ifdef HAVE_
MAEMO
#ifdef HAVE_
HILDON_FM
# include <hildon/hildon-file-chooser-dialog.h>
#endif
...
...
@@ -162,7 +162,7 @@ void open_cb( GtkMenuItem *menuitem, gpointer user_data )
GtkWidget
*
dialog
;
char
*
psz_filename
=
NULL
;
#ifdef HAVE_
MAEMO
#ifdef HAVE_
HILDON_FM
dialog
=
hildon_file_chooser_dialog_new
(
GTK_WINDOW
(
p_intf
->
p_sys
->
p_main_window
),
GTK_FILE_CHOOSER_ACTION_OPEN
);
#else
...
...
modules/gui/hildon/maemo_input.c
View file @
6f0b8197
...
...
@@ -30,11 +30,37 @@
#include "maemo.h"
#include "maemo_input.h"
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
static
void
update_position
(
intf_thread_t
*
p_intf
);
static
void
item_changed
(
intf_thread_t
*
p_intf
);
static
void
item_changed_pl
(
intf_thread_t
*
p_intf
);
static
int
input_event_cb
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
);
static
int
interface_changed_cb
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
);
static
gboolean
process_events
(
gpointer
data
);
void
set_input
(
intf_thread_t
*
p_intf
,
input_thread_t
*
p_input
);
void
delete_input
(
intf_thread_t
*
p_intf
);
gboolean
process_events
(
gpointer
data
)
/*****************************************************************************
* Functions.
*****************************************************************************/
void
post_event
(
intf_thread_t
*
p_intf
,
int
i_event
)
{
vlc_spin_lock
(
&
p_intf
->
p_sys
->
event_lock
);
p_intf
->
p_sys
->
i_event
|=
i_event
;
vlc_spin_unlock
(
&
p_intf
->
p_sys
->
event_lock
);
g_idle_add
(
process_events
,
p_intf
);
}
static
gboolean
process_events
(
gpointer
data
)
{
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
data
;
vlc_spin_lock
(
&
p_intf
->
p_sys
->
event_lock
);
...
...
@@ -43,19 +69,19 @@ gboolean process_events( gpointer data )
p_intf
->
p_sys
->
i_event
=
0
;
vlc_spin_unlock
(
&
p_intf
->
p_sys
->
event_lock
);
if
(
i_event
)
{
if
(
i_event
&
EVENT_PLAYLIST_CURRENT
)
item_changed_pl
(
p_intf
);
if
(
i_event
&
EVENT_ACTIVITY
)
item_changed_pl
(
p_intf
);
if
(
i_event
&
EVENT_ITEM_CHANGED
)
item_changed
(
p_intf
);
if
(
i_event
&
EVENT_INTF_CHANGED
)
update_position
(
p_intf
);
}
return
TRUE
;
if
(
!
i_event
)
return
TRUE
;
if
(
i_event
&
EVENT_PLAYLIST_CURRENT
)
item_changed_pl
(
p_intf
);
if
(
i_event
&
EVENT_ACTIVITY
)
item_changed_pl
(
p_intf
);
if
(
i_event
&
EVENT_ITEM_CHANGED
)
item_changed
(
p_intf
);
if
(
i_event
&
EVENT_INTF_CHANGED
)
update_position
(
p_intf
);
return
FALSE
;
}
void
set_input
(
intf_thread_t
*
p_intf
,
input_thread_t
*
p_input
)
...
...
@@ -88,7 +114,7 @@ void delete_input( intf_thread_t *p_intf )
}
}
void
item_changed_pl
(
intf_thread_t
*
p_intf
)
static
void
item_changed_pl
(
intf_thread_t
*
p_intf
)
{
if
(
p_intf
->
p_sys
->
p_input
&&
(
p_intf
->
p_sys
->
p_input
->
b_dead
||
p_intf
->
p_sys
->
p_input
->
b_die
)
)
...
...
@@ -107,30 +133,30 @@ void item_changed_pl( intf_thread_t *p_intf )
int
playlist_current_cb
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
{
(
void
)
p_this
;
(
void
)
psz_var
;
(
void
)
oldval
;
(
void
)
newval
;
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
param
;
vlc_spin_lock
(
&
p_intf
->
p_sys
->
event_lock
)
;
(
void
)
p_this
;
(
void
)
psz_var
;
(
void
)
oldval
;
(
void
)
newval
;
vlc_spin_lock
(
&
p_intf
->
p_sys
->
event_lock
);
p_intf
->
p_sys
->
i_event
|=
EVENT_PLAYLIST_CURRENT
;
vlc_spin_unlock
(
&
p_intf
->
p_sys
->
event_lock
);
g_idle_add
(
process_events
,
p_intf
);
return
VLC_SUCCESS
;
}
int
activity_cb
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
{
(
void
)
p_this
;
(
void
)
psz_var
;
(
void
)
oldval
;
(
void
)
newval
;
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
param
;
vlc_spin_lock
(
&
p_intf
->
p_sys
->
event_lock
)
;
(
void
)
p_this
;
(
void
)
psz_var
;
(
void
)
oldval
;
(
void
)
newval
;
vlc_spin_lock
(
&
p_intf
->
p_sys
->
event_lock
);
p_intf
->
p_sys
->
i_event
|=
EVENT_ACTIVITY
;
vlc_spin_unlock
(
&
p_intf
->
p_sys
->
event_lock
);
g_idle_add
(
process_events
,
p_intf
);
return
VLC_SUCCESS
;
}
void
item_changed
(
intf_thread_t
*
p_intf
)
static
void
item_changed
(
intf_thread_t
*
p_intf
)
{
GtkButton
*
p_button
=
GTK_BUTTON
(
p_intf
->
p_sys
->
p_play_button
);
vlc_value_t
state
;
...
...
@@ -154,15 +180,15 @@ int item_changed_cb( vlc_object_t *p_this, const char *psz_var,
{
(
void
)
p_this
;
(
void
)
psz_var
;
(
void
)
oldval
;
(
void
)
newval
;
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
param
;
vlc_spin_lock
(
&
p_intf
->
p_sys
->
event_lock
);
vlc_spin_lock
(
&
p_intf
->
p_sys
->
event_lock
);
p_intf
->
p_sys
->
i_event
|=
EVENT_ITEM_CHANGED
;
vlc_spin_unlock
(
&
p_intf
->
p_sys
->
event_lock
);
g_idle_add
(
process_events
,
p_intf
);
return
VLC_SUCCESS
;
}
void
update_position
(
intf_thread_t
*
p_intf
)
static
void
update_position
(
intf_thread_t
*
p_intf
)
{
if
(
p_intf
->
p_sys
->
p_input
)
{
...
...
@@ -173,16 +199,17 @@ void update_position( intf_thread_t *p_intf )
}
}
int
interface_changed_cb
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
static
int
interface_changed_cb
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
{
(
void
)
p_this
;
(
void
)
psz_var
;
(
void
)
oldval
;
(
void
)
newval
;
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
param
;
vlc_spin_lock
(
&
p_intf
->
p_sys
->
event_lock
)
;
(
void
)
p_this
;
(
void
)
psz_var
;
(
void
)
oldval
;
(
void
)
newval
;
vlc_spin_lock
(
&
p_intf
->
p_sys
->
event_lock
);
p_intf
->
p_sys
->
i_event
|=
EVENT_INTF_CHANGED
;
vlc_spin_unlock
(
&
p_intf
->
p_sys
->
event_lock
);
g_idle_add
(
process_events
,
p_intf
);
return
VLC_SUCCESS
;
}
...
...
modules/gui/hildon/maemo_input.h
View file @
6f0b8197
...
...
@@ -32,7 +32,7 @@
#define EVENT_ITEM_CHANGED (1<<3)
#define EVENT_INTF_CHANGED (1<<4)
gboolean
process_events
(
gpointer
data
);
void
post_event
(
intf_thread_t
*
p_intf
,
int
event
);
void
set_input
(
intf_thread_t
*
p_intf
,
input_thread_t
*
p_input
);
void
delete_input
(
intf_thread_t
*
p_intf
);
...
...
@@ -41,12 +41,6 @@ int playlist_current_cb( vlc_object_t *p_this, const char *psz_var,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
);
int
activity_cb
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
);
void
item_changed_pl
(
intf_thread_t
*
p_intf
);
int
item_changed_cb
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
);
void
item_changed
(
intf_thread_t
*
p_intf
);
int
interface_changed_cb
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
);
void
update_position
(
intf_thread_t
*
p_intf
);
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