* quicktime.c: a quicktime decoder that uses the QT library/dll
*****************************************************************************
* 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>
* Derk-Jan Hartman <thedj at users.sf.net>
vlc_module_begin();
set_description( _("QuickTime library decoder") );
- set_capability( "decoder", 100 );
+ set_capability( "decoder", 10 );
set_callbacks( OpenDecoder, NULL );
/* create a mutex */
* avi.c : AVI file Stream input module for vlc
*****************************************************************************
* 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>
*
* This program is free software; you can redistribute it and/or modify
p_input->pf_demux = AVIDemux_Seekable;
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;
}
* intf.h: MacOS X interface plugin
*****************************************************************************
* 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>
* Christophe Massiot <massiot@via.ecp.fr>
- (NSString *)localizedString:(char *)psz;
- (char *)delocalizeString:(NSString *)psz;
- (NSStringEncoding)getEncoding;
+- (NSString *)wrapString: (NSString *)o_in_string toWidth: (int)i_width;
- (void)setIntf:(intf_thread_t *)p_intf;
- (intf_thread_t *)getIntf;
* intf.m: MacOS X interface plugin
*****************************************************************************
* 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>
* Christophe Massiot <massiot@via.ecp.fr>
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
{
p_intf = _p_intf;
* prefs.h: MacOS X plugin for vlc
*****************************************************************************
* 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>
*
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-#define PREFS_WRAP 60
+#define PREFS_WRAP 300
@interface VLCTreeItem : NSObject
{
* prefs.m: MacOS X plugin for vlc
*****************************************************************************
* 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>
* Derk-Jan Hartman <thedj at users.sf.net>
{ \
char * psz_duptip = 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.width = w; \
s_rc.origin.y += 10; \
[o_text_field msg: param]; \
if ( psz_duptip != NULL ) \
{ \
- [o_text_field setToolTip: [NSApp localizedString: \
- psz_duptip]]; \
+ [o_text_field setToolTip: [NSApp wrapString: [NSApp localizedString: \
+ psz_duptip] toWidth: PREFS_WRAP ]]; \
free(psz_duptip);\
} \
[o_view addSubview: [o_text_field autorelease]]; \
char * psz_duptip = 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.width = 200;
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 );
}
[o_view addSubview: [o_modules autorelease]];
VLCComboBox *o_combo_box;
char * psz_duptip = 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.width = 200;
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 );
}
[o_view addSubview: [o_combo_box autorelease]];
VLCSlider *o_slider;
char * psz_duptip = 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.width = 200;
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 );
}
[o_slider setTarget: self];
VLCSlider *o_slider;
char * psz_duptip = 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.width = 200;
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 );
}
[o_slider setTarget: self];
char * psz_duptip = 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.width = s_vrc.size.width - X_ORIGIN * 2 - 20;
[o_btn_bool setTitle: [NSApp localizedString: p_item->psz_text]];
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 );
}
[o_btn_bool setTarget: self];