~ubuntu-branches/ubuntu/maverick/vlc/maverick

« back to all changes in this revision

Viewing changes to modules/control/showintf.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-09-17 21:56:14 UTC
  • mfrom: (1.1.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20080917215614-tj0vx8xzd57e52t8
Tags: 0.9.2-1ubuntu1
* New Upstream Release, exception granted by
    - dktrkranz, norsetto, Hobbsee (via irc). LP: #270404

Changes done in ubuntu:

* add libxul-dev to build-depends
* make sure that vlc is build against libxul in configure. This doesn't
  change anything in the package, but makes it more robust if building
  in an 'unclean' chroot or when modifying the package.
* debian/control: make Vcs-* fields point to the motumedia branch
* add libx264-dev and libass-dev to build-depends
  LP: #210354, #199870
* actually enable libass support by passing --enable-libass to configure
* enable libdca: add libdca-dev to build depends and --enable-libdca
* install the x264 plugin.

Changes already in the pkg-multimedia branch in debian:

* don't install usr/share/vlc/mozilla in debian/mozilla-plugin-vlc.install  
* new upstream .desktop file now registers flash video mimetype LP: #261567
* add Xb-Npp-Applications to mozilla-plugin-vlc
* remove duplicate entries in debian/vlc-nox.install

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * showintf.c: control the display of the interface in fullscreen mode
3
3
 *****************************************************************************
4
4
 * Copyright (C) 2004 the VideoLAN team
5
 
 * $Id: 1a98e7a1c2c355343e3881f60e0fe42c6011d419 $
 
5
 * $Id: bebf0679b1f8b559b07dd466ab61ffcfe5dcfe85 $
6
6
 *
7
7
 * Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
8
8
 *
24
24
/*****************************************************************************
25
25
 * Preamble
26
26
 *****************************************************************************/
27
 
#include <stdlib.h>                                      /* malloc(), free() */
28
 
#include <string.h>
29
 
 
30
 
#include <vlc/vlc.h>
31
 
#include <vlc/intf.h>
32
 
#include <vlc/vout.h>
 
27
 
 
28
#ifdef HAVE_CONFIG_H
 
29
# include "config.h"
 
30
#endif
 
31
 
 
32
#include <vlc_common.h>
 
33
#include <vlc_plugin.h>
 
34
#include <vlc_interface.h>
 
35
#include <vlc_vout.h>
 
36
#include <vlc_playlist.h>
33
37
 
34
38
#ifdef HAVE_UNISTD_H
35
39
#    include <unistd.h>
41
45
struct intf_sys_t
42
46
{
43
47
    vlc_object_t * p_vout;
44
 
    vlc_bool_t     b_button_pressed;
45
 
    vlc_bool_t     b_triggered;
 
48
    bool     b_button_pressed;
 
49
    bool     b_triggered;
46
50
    int            i_threshold;
47
51
};
48
52
 
49
53
/*****************************************************************************
50
54
 * Local prototypes.
51
55
 *****************************************************************************/
52
 
int  E_(Open) ( vlc_object_t * );
53
 
void E_(Close)( vlc_object_t * );
 
56
int  Open ( vlc_object_t * );
 
57
void Close( vlc_object_t * );
54
58
static void RunIntf( intf_thread_t *p_intf );
55
59
static int  InitThread( intf_thread_t *p_intf );
56
60
static int  MouseEvent( vlc_object_t *, char const *,
64
68
 
65
69
vlc_module_begin();
66
70
    set_shortname( "Showintf" );
67
 
    add_integer( "showintf-threshold", 10, NULL, THRESHOLD_TEXT, THRESHOLD_LONGTEXT, VLC_TRUE );
68
 
    set_description( _("Show interface with mouse") );
 
71
    add_integer( "showintf-threshold", 10, NULL, THRESHOLD_TEXT, THRESHOLD_LONGTEXT, true );
 
72
    set_description( N_("Show interface with mouse") );
69
73
 
70
74
    set_capability( "interface", 0 );
71
 
    set_callbacks( E_(Open), E_(Close) );
 
75
    set_callbacks( Open, Close );
72
76
vlc_module_end();
73
77
 
74
78
/*****************************************************************************
75
79
 * Open: initialize interface
76
80
 *****************************************************************************/
77
 
int E_(Open)( vlc_object_t *p_this )
 
81
int Open( vlc_object_t *p_this )
78
82
{
79
83
    intf_thread_t *p_intf = (intf_thread_t *)p_this;
80
84
 
93
97
/*****************************************************************************
94
98
 * Close: destroy interface
95
99
 *****************************************************************************/
96
 
void E_(Close)( vlc_object_t *p_this )
 
100
void Close( vlc_object_t *p_this )
97
101
{
98
102
    intf_thread_t *p_intf = (intf_thread_t *)p_this;
99
103
 
116
120
    }
117
121
 
118
122
    /* Main loop */
119
 
    while( !p_intf->b_die )
 
123
    while( !intf_ShouldDie( p_intf ) )
120
124
    {
121
125
        vlc_mutex_lock( &p_intf->change_lock );
122
126
 
123
127
        /* Notify the interfaces */
124
128
        if( p_intf->p_sys->b_triggered )
125
129
        {
126
 
            playlist_t *p_playlist =
127
 
                (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
128
 
                                               FIND_ANYWHERE );
129
 
 
130
 
            if( p_playlist != NULL )
131
 
            {
132
 
                vlc_value_t val;
133
 
                val.b_bool = VLC_TRUE;
134
 
                var_Set( p_playlist, "intf-show", val );
135
 
                vlc_object_release( p_playlist );
136
 
            }
137
 
            p_intf->p_sys->b_triggered = VLC_FALSE;
 
130
            var_SetBool( p_intf->p_libvlc, "intf-show", true );
 
131
            p_intf->p_sys->b_triggered = false;
138
132
        }
139
133
 
140
134
        vlc_mutex_unlock( &p_intf->change_lock );
141
135
 
142
136
 
143
137
        /* Take care of the video output */
144
 
        if( p_intf->p_sys->p_vout && p_intf->p_sys->p_vout->b_die )
 
138
        if( p_intf->p_sys->p_vout && !vlc_object_alive (p_intf->p_sys->p_vout) )
145
139
        {
146
140
            var_DelCallback( p_intf->p_sys->p_vout, "mouse-moved",
147
141
                             MouseEvent, p_intf );
183
177
 *****************************************************************************/
184
178
static int InitThread( intf_thread_t * p_intf )
185
179
{
186
 
    if( !p_intf->b_die )
 
180
    if( !intf_ShouldDie( p_intf ) )
187
181
    {
188
182
        vlc_mutex_lock( &p_intf->change_lock );
189
183
 
190
 
        p_intf->p_sys->b_triggered = VLC_FALSE;
191
 
        p_intf->p_sys->b_button_pressed = VLC_FALSE;
 
184
        p_intf->p_sys->b_triggered = false;
 
185
        p_intf->p_sys->b_button_pressed = false;
192
186
        p_intf->p_sys->i_threshold =
193
187
            config_GetInt( p_intf, "showintf-threshold" );
194
188
 
208
202
static int MouseEvent( vlc_object_t *p_this, char const *psz_var,
209
203
                       vlc_value_t oldval, vlc_value_t newval, void *p_data )
210
204
{
 
205
    VLC_UNUSED(p_this); VLC_UNUSED(oldval); VLC_UNUSED(newval);
211
206
    vlc_value_t val;
212
207
 
213
208
    int i_mouse_x, i_mouse_y;
234
229
        if ( i_mouse_y < p_intf->p_sys->i_threshold )
235
230
        {
236
231
            msg_Dbg( p_intf, "interface showing requested" );
237
 
            p_intf->p_sys->b_triggered = VLC_TRUE;
 
232
            p_intf->p_sys->b_triggered = true;
238
233
        }
239
234
    }
240
235
 
243
238
    if( !p_intf->p_sys->b_button_pressed &&
244
239
        !strcmp( psz_var, "mouse-button-down" ) )
245
240
    {
246
 
        p_intf->p_sys->b_button_pressed = VLC_TRUE;
 
241
        p_intf->p_sys->b_button_pressed = true;
247
242
    }
248
243
    if( p_intf->p_sys->b_button_pressed &&
249
244
        !strcmp( psz_var, "mouse-button-down" ) )
250
245
    {
251
 
        p_intf->p_sys->b_button_pressed = VLC_FALSE;
 
246
        p_intf->p_sys->b_button_pressed = false;
252
247
    }
253
248
 
254
249
    vlc_mutex_unlock( &p_intf->change_lock );