Commit e230f122 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* modules/codec/quicktime.c: i had accidently upgraded this plugin to 100

* modules/demux/avi/avi.c: fixed a spelling error reported by emulynx
* modules/gui/macosx/intf.?: added a wrapString:toWidth function
* modules/gui/macosx/prefs.?: removed the use of vlc_wraptext, because it
  was ugly. now we use our own, osx method. This fixes tooltips in japanese
  I'm not sure, but i think src/extras/libc.c vlc_wraptext is now unused.
parent 2db764f9
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* quicktime.c: a quicktime decoder that uses the QT library/dll * quicktime.c: a quicktime decoder that uses the QT library/dll
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: quicktime.c,v 1.5 2003/05/24 02:48:55 hartman Exp $ * $Id: quicktime.c,v 1.6 2003/05/26 14:59:37 hartman Exp $
* *
* Authors: Laurent Aimar <fenrir at via.ecp.fr> * Authors: Laurent Aimar <fenrir at via.ecp.fr>
* Derk-Jan Hartman <thedj at users.sf.net> * Derk-Jan Hartman <thedj at users.sf.net>
...@@ -63,7 +63,7 @@ static int RunDecoderVideo( decoder_fifo_t * ); ...@@ -63,7 +63,7 @@ static int RunDecoderVideo( decoder_fifo_t * );
vlc_module_begin(); vlc_module_begin();
set_description( _("QuickTime library decoder") ); set_description( _("QuickTime library decoder") );
set_capability( "decoder", 100 ); set_capability( "decoder", 10 );
set_callbacks( OpenDecoder, NULL ); set_callbacks( OpenDecoder, NULL );
/* create a mutex */ /* create a mutex */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* avi.c : AVI file Stream input module for vlc * avi.c : AVI file Stream input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: avi.c,v 1.48 2003/05/22 21:42:44 gbazin Exp $ * $Id: avi.c,v 1.49 2003/05/26 14:59:37 hartman Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -960,7 +960,7 @@ static int AVIInit( vlc_object_t * p_this ) ...@@ -960,7 +960,7 @@ static int AVIInit( vlc_object_t * p_this )
p_input->pf_demux = AVIDemux_Seekable; p_input->pf_demux = AVIDemux_Seekable;
if( AVI_TestFile( p_input ) ) if( AVI_TestFile( p_input ) )
{ {
msg_Warn( p_input, "avi module discarded (invalid headr)" ); msg_Warn( p_input, "avi module discarded (invalid header)" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf.h: MacOS X interface plugin * intf.h: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 VideoLAN * Copyright (C) 2002-2003 VideoLAN
* $Id: intf.h,v 1.40 2003/05/20 18:53:03 hartman Exp $ * $Id: intf.h,v 1.41 2003/05/26 14:59:37 hartman Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
- (NSString *)localizedString:(char *)psz; - (NSString *)localizedString:(char *)psz;
- (char *)delocalizeString:(NSString *)psz; - (char *)delocalizeString:(NSString *)psz;
- (NSStringEncoding)getEncoding; - (NSStringEncoding)getEncoding;
- (NSString *)wrapString: (NSString *)o_in_string toWidth: (int)i_width;
- (void)setIntf:(intf_thread_t *)p_intf; - (void)setIntf:(intf_thread_t *)p_intf;
- (intf_thread_t *)getIntf; - (intf_thread_t *)getIntf;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf.m: MacOS X interface plugin * intf.m: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 VideoLAN * Copyright (C) 2002-2003 VideoLAN
* $Id: intf.m,v 1.86 2003/05/25 17:27:13 massiot Exp $ * $Id: intf.m,v 1.87 2003/05/26 14:59:37 hartman Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
...@@ -169,6 +169,49 @@ static void Run( intf_thread_t *p_intf ) ...@@ -169,6 +169,49 @@ static void Run( intf_thread_t *p_intf )
return i_encoding; return i_encoding;
} }
/* i_width is in pixels */
- (NSString *)wrapString: (NSString *)o_in_string toWidth: (int) i_width
{
NSMutableString *o_wrapped;
NSString *o_out_string;
NSRange glyphRange, effectiveRange, charRange;
NSRect lineFragmentRect;
unsigned glyphIndex, breaksInserted = 0;
NSTextStorage *o_storage = [[NSTextStorage alloc] initWithString: o_in_string
attributes: [NSDictionary dictionaryWithObjectsAndKeys:
[NSFont labelFontOfSize: 0.0], NSFontAttributeName, nil]];
NSLayoutManager *o_layout_manager = [[NSLayoutManager alloc] init];
NSTextContainer *o_container = [[NSTextContainer alloc]
initWithContainerSize: NSMakeSize(i_width, 2000)];
[o_layout_manager addTextContainer: o_container];
[o_container release];
[o_storage addLayoutManager: o_layout_manager];
[o_layout_manager release];
o_wrapped = [o_in_string mutableCopy];
glyphRange = [o_layout_manager glyphRangeForTextContainer: o_container];
for( glyphIndex = glyphRange.location ; glyphIndex < NSMaxRange(glyphRange) ;
glyphIndex += effectiveRange.length) {
lineFragmentRect = [o_layout_manager lineFragmentRectForGlyphAtIndex: glyphIndex
effectiveRange: &effectiveRange];
charRange = [o_layout_manager characterRangeForGlyphRange: effectiveRange
actualGlyphRange: &effectiveRange];
if ([o_wrapped lineRangeForRange:
NSMakeRange(charRange.location + breaksInserted, charRange.length)].length > charRange.length) {
[o_wrapped insertString: @"\n" atIndex: NSMaxRange(charRange) + breaksInserted];
breaksInserted++;
}
}
o_out_string = [NSString stringWithString: o_wrapped];
[o_wrapped release];
[o_storage release];
return o_out_string;
}
- (void)setIntf:(intf_thread_t *)_p_intf - (void)setIntf:(intf_thread_t *)_p_intf
{ {
p_intf = _p_intf; p_intf = _p_intf;
......
...@@ -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-2003 VideoLAN * Copyright (C) 2002-2003 VideoLAN
* $Id: prefs.h,v 1.8 2003/05/26 01:25:12 hartman Exp $ * $Id: prefs.h,v 1.9 2003/05/26 14:59:37 hartman Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* *
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* 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 #define PREFS_WRAP 300
@interface VLCTreeItem : NSObject @interface VLCTreeItem : NSObject
{ {
......
...@@ -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-2003 VideoLAN * Copyright (C) 2002-2003 VideoLAN
* $Id: prefs.m,v 1.29 2003/05/26 02:03:10 hartman Exp $ * $Id: prefs.m,v 1.30 2003/05/26 14:59:37 hartman Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <thedj at users.sf.net> * Derk-Jan Hartman <thedj at users.sf.net>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
{ \ { \
char * psz_duptip = NULL; \ char * psz_duptip = NULL; \
if ( p_item->psz_longtext != NULL ) \ if ( p_item->psz_longtext != NULL ) \
psz_duptip = vlc_wraptext( strdup( p_item->psz_longtext ), PREFS_WRAP ); \ psz_duptip = strdup( p_item->psz_longtext ); \
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; \
...@@ -265,8 +265,8 @@ ...@@ -265,8 +265,8 @@
[o_text_field msg: param]; \ [o_text_field msg: param]; \
if ( psz_duptip != NULL ) \ if ( psz_duptip != NULL ) \
{ \ { \
[o_text_field setToolTip: [NSApp localizedString: \ [o_text_field setToolTip: [NSApp wrapString: [NSApp localizedString: \
psz_duptip]]; \ psz_duptip] toWidth: PREFS_WRAP ]]; \
free(psz_duptip);\ free(psz_duptip);\
} \ } \
[o_view addSubview: [o_text_field autorelease]]; \ [o_view addSubview: [o_text_field autorelease]]; \
...@@ -323,7 +323,7 @@ ...@@ -323,7 +323,7 @@
char * psz_duptip = NULL; char * psz_duptip = NULL;
if ( p_item->psz_longtext != NULL ) if ( p_item->psz_longtext != NULL )
psz_duptip = vlc_wraptext( strdup( p_item->psz_longtext ), PREFS_WRAP ); psz_duptip = strdup( p_item->psz_longtext );
s_rc.size.height = 30; s_rc.size.height = 30;
s_rc.size.width = 200; s_rc.size.width = 200;
...@@ -340,7 +340,7 @@ ...@@ -340,7 +340,7 @@
if ( psz_duptip != NULL ) if ( psz_duptip != NULL )
{ {
[o_modules setToolTip: [NSApp localizedString: psz_duptip]]; [o_modules setToolTip: [NSApp wrapString: [NSApp localizedString: psz_duptip] toWidth: PREFS_WRAP]];
free( psz_duptip ); free( psz_duptip );
} }
[o_view addSubview: [o_modules autorelease]]; [o_view addSubview: [o_modules autorelease]];
...@@ -398,7 +398,7 @@ ...@@ -398,7 +398,7 @@
VLCComboBox *o_combo_box; VLCComboBox *o_combo_box;
char * psz_duptip = NULL; char * psz_duptip = NULL;
if ( p_item->psz_longtext != NULL ) if ( p_item->psz_longtext != NULL )
psz_duptip = vlc_wraptext( strdup( p_item->psz_longtext ), PREFS_WRAP ); psz_duptip = strdup( p_item->psz_longtext );
s_rc.size.height = 27; s_rc.size.height = 27;
s_rc.size.width = 200; s_rc.size.width = 200;
...@@ -415,7 +415,7 @@ ...@@ -415,7 +415,7 @@
if ( psz_duptip != NULL ) if ( psz_duptip != NULL )
{ {
[o_combo_box setToolTip: [NSApp localizedString: psz_duptip]]; [o_combo_box setToolTip: [NSApp wrapString: [NSApp localizedString: psz_duptip] toWidth: PREFS_WRAP]];
free( psz_duptip ); free( psz_duptip );
} }
[o_view addSubview: [o_combo_box autorelease]]; [o_view addSubview: [o_combo_box autorelease]];
...@@ -450,7 +450,7 @@ ...@@ -450,7 +450,7 @@
VLCSlider *o_slider; VLCSlider *o_slider;
char * psz_duptip = NULL; char * psz_duptip = NULL;
if ( p_item->psz_longtext != NULL ) if ( p_item->psz_longtext != NULL )
psz_duptip = vlc_wraptext( strdup( p_item->psz_longtext ), PREFS_WRAP ); psz_duptip = strdup( p_item->psz_longtext );
s_rc.size.height = 27; s_rc.size.height = 27;
s_rc.size.width = 200; s_rc.size.width = 200;
...@@ -465,7 +465,7 @@ ...@@ -465,7 +465,7 @@
if ( psz_duptip != NULL ) if ( psz_duptip != NULL )
{ {
[o_slider setToolTip: [NSApp localizedString: psz_duptip]]; [o_slider setToolTip: [NSApp wrapString: [NSApp localizedString: psz_duptip] toWidth: PREFS_WRAP]];
free( psz_duptip ); free( psz_duptip );
} }
[o_slider setTarget: self]; [o_slider setTarget: self];
...@@ -495,7 +495,7 @@ ...@@ -495,7 +495,7 @@
VLCSlider *o_slider; VLCSlider *o_slider;
char * psz_duptip = NULL; char * psz_duptip = NULL;
if ( p_item->psz_longtext != NULL ) if ( p_item->psz_longtext != NULL )
psz_duptip = vlc_wraptext( strdup( p_item->psz_longtext ), PREFS_WRAP ); psz_duptip = strdup( p_item->psz_longtext );
s_rc.size.height = 27; s_rc.size.height = 27;
s_rc.size.width = 200; s_rc.size.width = 200;
...@@ -510,7 +510,7 @@ ...@@ -510,7 +510,7 @@
if ( psz_duptip != NULL ) if ( psz_duptip != NULL )
{ {
[o_slider setToolTip: [NSApp localizedString: psz_duptip]]; [o_slider setToolTip: [NSApp wrapString: [NSApp localizedString: psz_duptip] toWidth: PREFS_WRAP]];
free( psz_duptip ); free( psz_duptip );
} }
[o_slider setTarget: self]; [o_slider setTarget: self];
...@@ -533,7 +533,7 @@ ...@@ -533,7 +533,7 @@
char * psz_duptip = NULL; char * psz_duptip = NULL;
if ( p_item->psz_longtext != NULL ) if ( p_item->psz_longtext != NULL )
psz_duptip = vlc_wraptext( strdup( p_item->psz_longtext ), PREFS_WRAP ); 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;
...@@ -547,7 +547,7 @@ ...@@ -547,7 +547,7 @@
[o_btn_bool setTitle: [NSApp localizedString: p_item->psz_text]]; [o_btn_bool setTitle: [NSApp localizedString: p_item->psz_text]];
if ( psz_duptip != NULL ) if ( psz_duptip != NULL )
{ {
[o_btn_bool setToolTip: [NSApp localizedString: psz_duptip]]; [o_btn_bool setToolTip: [NSApp wrapString: [NSApp localizedString: psz_duptip] toWidth: PREFS_WRAP]];
free( psz_duptip ); free( psz_duptip );
} }
[o_btn_bool setTarget: self]; [o_btn_bool setTarget: self];
......
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