Commit 461358ec authored by Christophe Massiot's avatar Christophe Massiot

* src/extras/libc.c: New vlc_wraptext function,

* modules/gui/macosx/prefs.m: Wrap tool tips to 60 characters,
* src/input/input.c: Correctly parse MRL of the type
  /Volumes/toto:titi/coincoin.mpg (closes #238 & #186)
* modules/access/*: Changed some msg_Warn into msg_Err
* po/fr.po: Updated French translation,
* configure.ac.in: Re-enabled Swedish translation,
* Makefile.am: Do not recompile everything everytime someone changes a .h
parent 3d9124d0
...@@ -207,7 +207,11 @@ include/vlc_symbols.h: Makefile $(HEADERS_include) ...@@ -207,7 +207,11 @@ include/vlc_symbols.h: Makefile $(HEADERS_include)
echo '#ifdef __PLUGIN__' >> $@.in echo '#ifdef __PLUGIN__' >> $@.in
cat $(HEADERS_include) | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/# define \2 p_symbols->\2_inner/' >> $@.in cat $(HEADERS_include) | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/# define \2 p_symbols->\2_inner/' >> $@.in
echo '#endif /* __PLUGIN__ */' >> $@.in echo '#endif /* __PLUGIN__ */' >> $@.in
mv -f $@.in $@ if ! diff -q $@ $@.in; then \
mv -f $@.in $@ ; \
else \
rm -f $@.in ; \
fi
src/misc/modules_plugin.h: Makefile src/misc/modules_plugin.h.in $(HEADERS_include) src/misc/modules_plugin.h: Makefile src/misc/modules_plugin.h.in $(HEADERS_include)
rm -f $@.tmp && cp $@.in $@.tmp rm -f $@.tmp && cp $@.in $@.tmp
...@@ -215,7 +219,11 @@ src/misc/modules_plugin.h: Makefile src/misc/modules_plugin.h.in $(HEADERS_inclu ...@@ -215,7 +219,11 @@ src/misc/modules_plugin.h: Makefile src/misc/modules_plugin.h.in $(HEADERS_inclu
echo '#define STORE_SYMBOLS( p_symbols ) \' >> $@.tmp echo '#define STORE_SYMBOLS( p_symbols ) \' >> $@.tmp
cat $(HEADERS_include) | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ (p_symbols)->\2_inner = \2; \\/' >> $@.tmp cat $(HEADERS_include) | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ (p_symbols)->\2_inner = \2; \\/' >> $@.tmp
echo '' >> $@.tmp echo '' >> $@.tmp
mv -f $@.tmp $@ if ! diff -q $@ $@.tmp; then \
mv -f $@.tmp $@ ; \
else \
rm -f $@.tmp ; \
fi
src/misc/modules_builtin.h: Makefile src/misc/modules_builtin.h.in src/misc/modules_builtin.h: Makefile src/misc/modules_builtin.h.in
rm -f $@.tmp && cp $@.in $@.tmp rm -f $@.tmp && cp $@.in $@.tmp
...@@ -231,7 +239,11 @@ if HAVE_BUILTINS ...@@ -231,7 +239,11 @@ if HAVE_BUILTINS
endif endif
echo " } while( 0 );" >> $@.tmp echo " } while( 0 );" >> $@.tmp
echo "" >> $@.tmp echo "" >> $@.tmp
mv -f $@.tmp $@ if ! diff -q $@ $@.tmp; then \
mv -f $@.tmp $@ ; \
else \
rm -f $@.tmp ; \
fi
# These dependencies are mandatory # These dependencies are mandatory
$(SOURCES): include/vlc_symbols.h $(SOURCES): include/vlc_symbols.h
......
...@@ -169,7 +169,7 @@ AM_CONDITIONAL(HAVE_WIN32, test "x${SYS}" = "xmingw32") ...@@ -169,7 +169,7 @@ AM_CONDITIONAL(HAVE_WIN32, test "x${SYS}" = "xmingw32")
dnl dnl
dnl Gettext stuff dnl Gettext stuff
dnl dnl
ALL_LINGUAS="de en_GB fr it ja no ru nl pl" ALL_LINGUAS="de en_GB fr it ja no ru nl pl sv"
AM_GNU_GETTEXT_VERSION(0.10.40) AM_GNU_GETTEXT_VERSION(0.10.40)
AM_GNU_GETTEXT AM_GNU_GETTEXT
if test "${nls_cv_force_use_gnu_gettext}" = "yes"; then if test "${nls_cv_force_use_gnu_gettext}" = "yes"; then
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* control the pace of reading. * control the pace of reading.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.84 2003/01/16 23:25:54 lool Exp $ * $Id: input_ext-intf.h,v 1.85 2003/02/08 22:20:28 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -330,6 +330,7 @@ struct input_thread_t ...@@ -330,6 +330,7 @@ struct input_thread_t
/* Playlist item */ /* Playlist item */
char * psz_source; char * psz_source;
char * psz_dupsource;
char * psz_access; char * psz_access;
char * psz_demux; char * psz_demux;
char * psz_name; char * psz_name;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions * Collection of useful common types and macros definitions
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc_common.h,v 1.52 2003/01/28 17:11:38 sam Exp $ * $Id: vlc_common.h,v 1.53 2003/02/08 22:20:28 massiot Exp $
* *
* Authors: Samuel Hocevar <sam@via.ecp.fr> * Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr> * Vincent Seguin <seguin@via.ecp.fr>
...@@ -542,6 +542,8 @@ static inline uint64_t U64_AT( void * _p ) ...@@ -542,6 +542,8 @@ static inline uint64_t U64_AT( void * _p )
# define vlc_strncasecmp NULL # define vlc_strncasecmp NULL
#endif #endif
VLC_EXPORT( char *, vlc_wraptext, ( char *psz_text, size_t i_line ) );
/* Format type specifiers for 64 bits numbers */ /* Format type specifiers for 64 bits numbers */
#if !defined(WIN32) && !defined(UNDER_CE) #if !defined(WIN32) && !defined(UNDER_CE)
# define I64Fd "%lld" # define I64Fd "%lld"
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* -udf.* to find files * -udf.* to find files
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: access.c,v 1.9 2003/01/28 22:03:21 sam Exp $ * $Id: access.c,v 1.10 2003/02/08 22:20:28 massiot Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -816,7 +816,7 @@ static char * DVDParse( input_thread_t * p_input ) ...@@ -816,7 +816,7 @@ static char * DVDParse( input_thread_t * p_input )
/* check block device */ /* check block device */
if( stat( psz_device, &stat_info ) == -1 ) if( stat( psz_device, &stat_info ) == -1 )
{ {
msg_Err( p_input, "cannot stat() device `%s' (%s)", msg_Warn( p_input, "cannot stat() device `%s' (%s)",
psz_device, strerror(errno)); psz_device, strerror(errno));
free( psz_device ); free( psz_device );
return NULL; return NULL;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* file.c: file input (file: access plug-in) * file.c: file input (file: access plug-in)
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: file.c,v 1.9 2003/01/05 20:45:29 massiot Exp $ * $Id: file.c,v 1.10 2003/02/08 22:20:28 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -108,10 +108,10 @@ static int Open( vlc_object_t *p_this ) ...@@ -108,10 +108,10 @@ static int Open( vlc_object_t *p_this )
if( !b_stdin && (i_stat = stat( psz_name, &stat_info )) == (-1) ) if( !b_stdin && (i_stat = stat( psz_name, &stat_info )) == (-1) )
{ {
# ifdef HAVE_ERRNO_H # ifdef HAVE_ERRNO_H
msg_Err( p_input, "cannot stat() file `%s' (%s)", msg_Warn( p_input, "cannot stat() file `%s' (%s)",
psz_name, strerror(errno)); psz_name, strerror(errno));
# else # else
msg_Err( p_input, "cannot stat() file `%s'", psz_name ); msg_Warn( p_input, "cannot stat() file `%s'", psz_name );
# endif # endif
return VLC_EGENERIC; return VLC_EGENERIC;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* prefs.h: MacOS X plugin for vlc * prefs.h: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: prefs.h,v 1.1 2002/11/05 03:57:16 jlj Exp $ * $Id: prefs.h,v 1.2 2003/02/08 22:20:28 massiot Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* *
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
#define PREFS_WRAP 60
/***************************************************************************** /*****************************************************************************
* VLCPrefs interface * VLCPrefs interface
*****************************************************************************/ *****************************************************************************/
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* prefs.m: MacOS X plugin for vlc * prefs.m: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: prefs.m,v 1.10 2003/01/31 02:53:52 jlj Exp $ * $Id: prefs.m,v 1.11 2003/02/08 22:20:28 massiot Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* *
...@@ -243,6 +243,7 @@ ...@@ -243,6 +243,7 @@
#define INPUT_FIELD( ctype, cname, label, w, msg, param, tip ) \ #define INPUT_FIELD( ctype, cname, label, w, msg, param, tip ) \
{ \ { \
char * psz_duptip = strdup(tip); \
s_rc.size.height = 25; \ s_rc.size.height = 25; \
s_rc.size.width = w; \ s_rc.size.width = w; \
s_rc.origin.y += 10; \ s_rc.origin.y += 10; \
...@@ -251,7 +252,12 @@ ...@@ -251,7 +252,12 @@
[o_text_field setAlignment: NSRightTextAlignment]; \ [o_text_field setAlignment: NSRightTextAlignment]; \
CONTROL_CONFIG( o_text_field, o_module_name, ctype, cname ); \ CONTROL_CONFIG( o_text_field, o_module_name, ctype, cname ); \
[o_text_field msg: param]; \ [o_text_field msg: param]; \
[o_text_field setToolTip: [NSApp localizedString: tip]]; \ if ( psz_duptip != NULL ) \
{ \
[o_text_field setToolTip: [NSApp localizedString: \
vlc_wraptext(psz_duptip, PREFS_WRAP)]]; \
free(psz_duptip);\
} \
[o_view addSubview: [o_text_field autorelease]]; \ [o_view addSubview: [o_text_field autorelease]]; \
[[NSNotificationCenter defaultCenter] addObserver: self \ [[NSNotificationCenter defaultCenter] addObserver: self \
selector: @selector(configChanged:) \ selector: @selector(configChanged:) \
...@@ -318,6 +324,7 @@ ...@@ -318,6 +324,7 @@
NSPopUpButton *o_modules; NSPopUpButton *o_modules;
NSButton *o_btn_select; NSButton *o_btn_select;
NSButton *o_btn_configure; NSButton *o_btn_configure;
char * psz_duptip = strdup(p_item->psz_longtext);
#define MODULE_BUTTON( button, title, sel ) \ #define MODULE_BUTTON( button, title, sel ) \
{ \ { \
...@@ -353,7 +360,12 @@ ...@@ -353,7 +360,12 @@
[o_modules setTag: i_module_tag++]; [o_modules setTag: i_module_tag++];
[o_modules setTarget: self]; [o_modules setTarget: self];
[o_modules setAction: @selector(moduleSelected:)]; [o_modules setAction: @selector(moduleSelected:)];
[o_modules setToolTip: [NSApp localizedString: p_item->psz_longtext]]; if ( psz_duptip != NULL )
{
[o_modules setToolTip: [NSApp localizedString:
vlc_wraptext(psz_duptip, PREFS_WRAP)]];
free( psz_duptip );
}
[o_cview addSubview: [o_modules autorelease]]; [o_cview addSubview: [o_modules autorelease]];
MODULE_BUTTON( o_btn_configure, _NS("Configure"), MODULE_BUTTON( o_btn_configure, _NS("Configure"),
...@@ -430,6 +442,7 @@ ...@@ -430,6 +442,7 @@
{ {
int i; int i;
VLCComboBox *o_combo_box; VLCComboBox *o_combo_box;
char * psz_duptip = strdup(p_item->psz_longtext);
s_rc.size.height = 27; s_rc.size.height = 27;
s_rc.size.width = 150; s_rc.size.width = 150;
...@@ -440,8 +453,12 @@ ...@@ -440,8 +453,12 @@
o_combo_box = [[VLCComboBox alloc] initWithFrame: s_rc]; o_combo_box = [[VLCComboBox alloc] initWithFrame: s_rc];
CONTROL_CONFIG( o_combo_box, o_module_name, CONTROL_CONFIG( o_combo_box, o_module_name,
CONFIG_ITEM_STRING, p_item->psz_name ); CONFIG_ITEM_STRING, p_item->psz_name );
[o_combo_box setToolTip: if ( psz_duptip != NULL )
[NSApp localizedString: p_item->psz_longtext]]; {
[o_combo_box setToolTip: [NSApp localizedString:
vlc_wraptext(psz_duptip, PREFS_WRAP)]];
free( psz_duptip );
}
[o_view addSubview: [o_combo_box autorelease]]; [o_view addSubview: [o_combo_box autorelease]];
[[NSNotificationCenter defaultCenter] addObserver: self [[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(configChanged:) selector: @selector(configChanged:)
...@@ -484,6 +501,7 @@ ...@@ -484,6 +501,7 @@
case CONFIG_ITEM_BOOL: case CONFIG_ITEM_BOOL:
{ {
VLCButton *o_btn_bool; VLCButton *o_btn_bool;
char * psz_duptip = strdup(p_item->psz_longtext);
s_rc.size.height = 27; s_rc.size.height = 27;
s_rc.size.width = s_vrc.size.width - X_ORIGIN * 2 - 20; s_rc.size.width = s_vrc.size.width - X_ORIGIN * 2 - 20;
...@@ -496,8 +514,12 @@ ...@@ -496,8 +514,12 @@
[o_btn_bool setIntValue: p_item->i_value]; [o_btn_bool setIntValue: p_item->i_value];
[o_btn_bool setTitle: [o_btn_bool setTitle:
[NSApp localizedString: p_item->psz_text]]; [NSApp localizedString: p_item->psz_text]];
[o_btn_bool setToolTip: if ( psz_duptip != NULL )
[NSApp localizedString: p_item->psz_longtext]]; {
[o_btn_bool setToolTip: [NSApp localizedString:
vlc_wraptext(psz_duptip, PREFS_WRAP)]];
free( psz_duptip );
}
[o_btn_bool setTarget: self]; [o_btn_bool setTarget: self];
[o_btn_bool setAction: @selector(configChanged:)]; [o_btn_bool setAction: @selector(configChanged:)];
CONTROL_CONFIG( o_btn_bool, o_module_name, CONTROL_CONFIG( o_btn_bool, o_module_name,
......
...@@ -336,7 +336,7 @@ msgstr "module de filtre vid ...@@ -336,7 +336,7 @@ msgstr "module de filtre vid
msgid "" msgid ""
"This will allow you to add a post-processing filter to enhance the picture " "This will allow you to add a post-processing filter to enhance the picture "
"quality, for instance deinterlacing, or to clone or distort the video window." "quality, for instance deinterlacing, or to clone or distort the video window."
msgstr "Cette option vous permet d'ajouter un filter de post-processing pour amliorer la qualit de l'image, par exemple du dsentralement, ou pour dupliquer ou dformer la fentre video." msgstr "Cette option vous permet d'ajouter un filtre de post-processing pour amliorer la qualit de l'image, par exemple du dsentralement, ou pour dupliquer ou dformer la fentre video."
#: src/libvlc.h:172 #: src/libvlc.h:172
msgid "source aspect ratio" msgid "source aspect ratio"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libc.c: Extra libc function for some systems. * libc.c: Extra libc function for some systems.
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: libc.c,v 1.6 2002/12/30 13:34:03 sam Exp $ * $Id: libc.c,v 1.7 2003/02/08 22:20:28 massiot Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -171,3 +171,55 @@ char *vlc_dgettext( const char *package, const char *msgid ) ...@@ -171,3 +171,55 @@ char *vlc_dgettext( const char *package, const char *msgid )
#endif #endif
} }
/*****************************************************************************
* wraptext: insert \n at convenient places. CAUTION: modifies its argument
*****************************************************************************/
char *vlc_wraptext( char *psz_text, size_t i_line )
{
size_t i_len = strlen(psz_text);
char * psz_line = psz_text;
while ( i_len > i_line )
{
/* Look if there is a newline somewhere. */
char * psz_parser = psz_line;
while ( psz_parser <= psz_line + i_line && *psz_parser != '\n' )
{
psz_parser++;
}
if ( *psz_parser == '\n' )
{
i_len -= psz_parser + 1 - psz_line;
psz_line = psz_parser + 1;
continue;
}
/* Find the furthest space. */
psz_parser = psz_line + i_line;
while ( psz_parser > psz_line && *psz_parser != ' ' )
{
psz_parser--;
}
if ( *psz_parser == ' ' )
{
*psz_parser = '\n';
i_len -= psz_parser + 1 - psz_line;
psz_line = psz_parser + 1;
continue;
}
/* Wrapping has failed. Find the first space or newline after i_line. */
psz_parser = psz_line + i_line + 1;
while ( psz_parser < psz_line + i_len
&& *psz_parser != ' ' && *psz_parser != '\n' )
{
psz_parser++;
}
if ( psz_parser < psz_line + i_len ) *psz_parser = '\n';
i_len -= psz_parser + 1 - psz_line;
psz_line = psz_parser + 1;
}
return psz_text;
}
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* decoders. * decoders.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2002 VideoLAN * Copyright (C) 1998-2002 VideoLAN
* $Id: input.c,v 1.221 2002/12/31 01:54:36 massiot Exp $ * $Id: input.c,v 1.222 2003/02/08 22:20:28 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -370,7 +370,7 @@ static int RunThread( input_thread_t *p_input ) ...@@ -370,7 +370,7 @@ static int RunThread( input_thread_t *p_input )
static int InitThread( input_thread_t * p_input ) static int InitThread( input_thread_t * p_input )
{ {
/* Parse source string. Syntax : [[<access>][/<demux>]:][<source>] */ /* Parse source string. Syntax : [[<access>][/<demux>]:][<source>] */
char * psz_parser = p_input->psz_source; char * psz_parser = p_input->psz_dupsource = strdup(p_input->psz_source);
/* Skip the plug-in names */ /* Skip the plug-in names */
while( *psz_parser && *psz_parser != ':' ) while( *psz_parser && *psz_parser != ':' )
...@@ -390,6 +390,8 @@ static int InitThread( input_thread_t * p_input ) ...@@ -390,6 +390,8 @@ static int InitThread( input_thread_t * p_input )
{ {
p_input->psz_access = p_input->psz_demux = ""; p_input->psz_access = p_input->psz_demux = "";
p_input->psz_name = p_input->psz_source; p_input->psz_name = p_input->psz_source;
free( p_input->psz_dupsource);
p_input->psz_dupsource = NULL;
} }
else else
{ {
...@@ -455,6 +457,20 @@ static int InitThread( input_thread_t * p_input ) ...@@ -455,6 +457,20 @@ static int InitThread( input_thread_t * p_input )
p_input->p_access = module_Need( p_input, "access", p_input->p_access = module_Need( p_input, "access",
p_input->psz_access ); p_input->psz_access );
if ( p_input->p_access == NULL
&& (*p_input->psz_demux || *p_input->psz_access) )
{
/* Maybe we got something like :
* /Volumes/toto:titi/gabu.mpg */
p_input->psz_access = p_input->psz_demux = "";
p_input->psz_name = p_input->psz_source;
free( p_input->psz_dupsource);
p_input->psz_dupsource = NULL;
p_input->p_access = module_Need( p_input, "access",
p_input->psz_access );
}
if( p_input->p_access == NULL ) if( p_input->p_access == NULL )
{ {
msg_Err( p_input, "no suitable access module for `%s/%s://%s'", msg_Err( p_input, "no suitable access module for `%s/%s://%s'",
...@@ -571,6 +587,7 @@ static void EndThread( input_thread_t * p_input ) ...@@ -571,6 +587,7 @@ static void EndThread( input_thread_t * p_input )
input_AccessEnd( p_input ); input_AccessEnd( p_input );
free( p_input->psz_source ); free( p_input->psz_source );
if ( p_input->psz_dupsource != NULL ) free( p_input->psz_dupsource );
/* Tell we're dead */ /* Tell we're dead */
p_input->b_dead = 1; p_input->b_dead = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment