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

* OSX lowlevel work

  - The VLCApplication is now launched at the vlc.c level instead of at the module level. Allows VLC to be a more valid Mac application, also removes the vout intf dependancy (use ncurses to disp. video :).
    This wasn't done at the libvlc level, because a mozilla plugin would no longer be able to function properly.
  - Some functionality of the macosx vout may not work without the OS X GUI, and not all of this is checked yet.
  - There is a symlink in VLC.app/Contents/Mac called clivlc that will force it back to a fullblown cli app when you want, so it can still be run by a user who isn't logged in via GUI.
  - there are some autorelease leaks which need to be tackled.
  - moved a lot of the VLCApplication func. to the VLCMain class.
  - VLCMain is a +sharedInstance now.
  - the complete OS X interface is still badly broken because of the many API changes lately. any volunteers?

Examples:
VLC.app/Contents/MacOS/VLC [-I macosx]
launches VLC as before (requires you to be logged in via GUI)

VLC.app/Contents/MacOS/VLC -I ncurses
launch vlc with a ncurses intf and display video on your mac
(requires you to be logged in via GUI)

VLC.app/Contents/MacOS/clivlc -I telnet -d
launch vlm remotely trough ssh in daemon mode, on a GUI'less server for instance, and stream your vids

Now how is that for combining GUI and cli in one application on the mac?!!? :)
jlj? I finally understand now how the OS X interface works !
parent 7b5375e2
......@@ -492,6 +492,7 @@ VLC.app: vlc
$(INSTALL) -d $(top_builddir)/VLC.app/Contents/MacOS
$(INSTALL) $(top_builddir)/vlc \
$(top_builddir)/VLC.app/Contents/MacOS/VLC
ln -sf ./VLC $(top_builddir)/VLC.app/Contents/MacOS/clivlc
$(INSTALL) -d $(top_builddir)/VLC.app/Contents/MacOS/modules
for i in "" `$(VLC_CONFIG) --target plugin` ; do \
if test -n "$$i" ; \
......
......@@ -183,6 +183,13 @@ Description: DVB info in NIT
We need to get the information of a DVB stream that are in the NIT (current program, next program, ...)
Status: Todo
Task
Difficulty: Medium
Urgency: Wishlist
Platform: any
Description: IceCast/ShoutCast serving
This would be a nice thing for the sake of completeness of VLC's streaming capabilities.
Status: Todo
Task
Difficulty: Hard
......
......@@ -120,6 +120,7 @@ case "${target_os}" in
OBJCFLAGS_save="${OBJCFLAGS_save} -no-cpp-precomp -D_INTL_REDIRECT_MACROS"; OBJCFLAGS="${OBJCFLAGS_save}"
VLC_ADD_LDFLAGS([vlc ffmpeg],[-all_load])
VLC_ADD_LDFLAGS([mp4], [-framework IOKit -framework CoreFoundation])
VLC_ADD_CFLAGS([vlc],[-x objective-c])
VLC_ADD_LDFLAGS([vlc],[-Wl,-multiply_defined,suppress])
;;
*mingw32* | *cygwin*)
......@@ -1237,7 +1238,6 @@ then
],[
if test -n "${enable_dvdread}"
then
AC_MSG_WARN([Please get libdvdread from http://www.dtek.chalmers.se/groups/dvd/downloads.shtml])
AC_MSG_ERROR([cannot find libdvdread headers])
fi
])
......
......@@ -21,12 +21,12 @@
</array>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
<integer>1617</integer>
<integer>21</integer>
<integer>1617</integer>
<integer>1647</integer>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>7F44</string>
<string>7H63</string>
</dict>
</plist>
......@@ -41,7 +41,7 @@
if ( [o_command isEqualToString:@"GetURL"] || [o_command isEqualToString:@"OpenURL"] )
{
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
......@@ -84,7 +84,7 @@
- (id)performDefaultImplementation {
NSString *o_command = [[self commandDescription] commandName];
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
......
......@@ -45,7 +45,7 @@
{
vlc_value_t val;
playlist_t * p_playlist;
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT,
FIND_ANYWHERE );
......@@ -87,7 +87,7 @@
- (IBAction)stop:(id)sender
{
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist != NULL )
......@@ -100,7 +100,7 @@
- (IBAction)faster:(id)sender
{
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT,
FIND_ANYWHERE );
if( p_input != NULL )
......@@ -115,7 +115,7 @@
- (IBAction)slower:(id)sender
{
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT,
FIND_ANYWHERE );
if( p_input != NULL )
......@@ -130,7 +130,7 @@
- (IBAction)prev:(id)sender
{
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist )
......@@ -143,7 +143,7 @@
- (IBAction)next:(id)sender
{
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist )
......@@ -156,7 +156,7 @@
- (IBAction)random:(id)sender
{
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
vlc_value_t val;
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
......@@ -184,7 +184,7 @@
- (IBAction)repeat:(id)sender
{
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
vlc_value_t val;
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
......@@ -216,7 +216,7 @@
- (IBAction)loop:(id)sender
{
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
vlc_value_t val;
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
......@@ -248,7 +248,7 @@
- (IBAction)forward:(id)sender
{
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT,
FIND_ANYWHERE );
if( p_input != NULL )
......@@ -263,7 +263,7 @@
- (IBAction)backward:(id)sender
{
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT,
FIND_ANYWHERE );
if( p_input != NULL )
......@@ -279,7 +279,7 @@
- (IBAction)volumeUp:(id)sender
{
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
if( p_intf->p_sys->b_mute )
{
......@@ -293,7 +293,7 @@
- (IBAction)volumeDown:(id)sender
{
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
if( p_intf->p_sys->b_mute )
{
......@@ -307,7 +307,7 @@
- (IBAction)mute:(id)sender
{
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
audio_volume_t i_volume;
aout_VolumeMute( p_intf, &i_volume );
......@@ -318,7 +318,7 @@
- (IBAction)volumeSliderUpdated:(id)sender
{
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
audio_volume_t i_volume = (audio_volume_t)[sender intValue];
aout_VolumeSet( p_intf, i_volume * AOUT_VOLUME_STEP );
......@@ -326,7 +326,7 @@
- (void)updateVolumeSlider
{
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
audio_volume_t i_volume;
aout_VolumeGet( p_intf, &i_volume );
......@@ -343,7 +343,7 @@
NSString *o_title = [sender title];
NSArray *o_windows = [NSApp orderedWindows];
NSEnumerator *o_enumerator = [o_windows objectEnumerator];
vout_thread_t *p_vout = vlc_object_find( [NSApp getIntf], VLC_OBJECT_VOUT,
vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT,
FIND_ANYWHERE );
if( p_vout != NULL )
......@@ -408,7 +408,7 @@
/* Get the descriptive name of the variable */
var_Change( p_object, psz_variable, VLC_VAR_GETTEXT, &text, NULL );
[o_mi setTitle: [NSApp localizedString: text.psz_string ?
[o_mi setTitle: [[VLCMain sharedInstance] localizedString: text.psz_string ?
text.psz_string : strdup( psz_variable ) ]];
var_Get( p_object, psz_variable, &val );
......@@ -523,7 +523,7 @@
another_val.psz_string =
strdup(val_list.p_list->p_values[i].psz_string);
o_title = [NSApp localizedString: text_list.p_list->p_values[i].psz_string ?
o_title = [[VLCMain sharedInstance] localizedString: text_list.p_list->p_values[i].psz_string ?
text_list.p_list->p_values[i].psz_string : val_list.p_list->p_values[i].psz_string ];
o_lmi = [o_menu addItemWithTitle: o_title action: pf_callback keyEquivalent: @""];
......@@ -540,7 +540,7 @@
case VLC_VAR_INTEGER:
o_title = text_list.p_list->p_values[i].psz_string ?
[NSApp localizedString: strdup( text_list.p_list->p_values[i].psz_string )] :
[[VLCMain sharedInstance] localizedString: strdup( text_list.p_list->p_values[i].psz_string )] :
[NSString stringWithFormat: @"%d",
val_list.p_list->p_values[i].i_int];
......@@ -580,9 +580,9 @@
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
VLCMenuExt *o_data = (VLCMenuExt *)_o_data;
vlc_thread_set_priority( [NSApp getIntf] , VLC_THREAD_PRIORITY_LOW );
vlc_thread_set_priority( VLCIntf , VLC_THREAD_PRIORITY_LOW );
p_object = (vlc_object_t *)vlc_object_get( [NSApp getIntf],
p_object = (vlc_object_t *)vlc_object_get( VLCIntf,
[o_data objectID] );
if( p_object != NULL )
......@@ -604,7 +604,7 @@
{
BOOL bEnabled = TRUE;
vlc_value_t val;
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
......
......@@ -31,33 +31,18 @@
#include <Cocoa/Cocoa.h>
/*****************************************************************************
* VLCApplication interface
* Local prototypes.
*****************************************************************************/
@interface VLCApplication : NSApplication
{
intf_thread_t *p_intf;
}
- (NSString *)localizedString:(char *)psz;
- (char *)delocalizeString:(NSString *)psz;
- (NSString *)wrapString: (NSString *)o_in_string toWidth: (int)i_width;
- (void)setIntf:(intf_thread_t *)p_intf;
- (intf_thread_t *)getIntf;
- (BOOL)hasDefinedShortcutKey:(NSEvent *)o_event;
int ExecuteOnMainThread( id target, SEL sel, void * p_arg );
unsigned int CocoaKeyToVLC( unichar i_key );
@end
#define VLCIntf [[VLCMain sharedInstance] getIntf]
#define _NS(s) [NSApp localizedString: _(s)]
#define _NS(s) [[VLCMain sharedInstance] localizedString: _(s)]
/* Get an alternate version of the string.
* This string is stored as '1:string' but when displayed it only displays
* the translated string. the translation should be '1:translatedstring' though */
#define _ANS(s) [[NSApp localizedString: _(s)] substringFromIndex:2]
int ExecuteOnMainThread( id target, SEL sel, void * p_arg );
int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param );
unsigned int CocoaKeyToVLC( unichar i_key );
#define _ANS(s) [[[VLCMain sharedInstance] localizedString: _(s)] substringFromIndex:2]
/*****************************************************************************
* intf_sys_t: description and status of the interface
......@@ -92,6 +77,7 @@ struct intf_sys_t
*****************************************************************************/
@interface VLCMain : NSObject
{
intf_thread_t *p_intf; /* The main intf object */
id o_prefs; /* VLCPrefs */
IBOutlet id o_window; /* main window */
......@@ -238,10 +224,19 @@ struct intf_sys_t
IBOutlet id o_dmi_mute;
}
+ (VLCMain *)sharedInstance;
- (intf_thread_t *)getIntf;
- (void)setIntf:(intf_thread_t *)p_mainintf;
- (id)getControls;
- (id)getPlaylist;
- (id)getInfo;
- (void)terminate;
- (NSString *)localizedString:(char *)psz;
- (char *)delocalizeString:(NSString *)psz;
- (NSString *)wrapString: (NSString *)o_in_string toWidth: (int)i_width;
- (BOOL)hasDefinedShortcutKey:(NSEvent *)o_event;
- (void)initStrings;
......
......@@ -70,10 +70,7 @@ int E_(OpenIntf) ( vlc_object_t *p_this )
p_intf->b_play = VLC_TRUE;
p_intf->pf_run = Run;
[VLCApplication sharedApplication];
[NSApp setIntf: p_intf];
[NSBundle loadNibNamed: @"MainMenu" owner: NSApp];
[[VLCMain sharedInstance] setIntf: p_intf];
return( 0 );
}
......@@ -102,162 +99,9 @@ static void Run( intf_thread_t *p_intf )
* fails to go to real-time priority with the first launched thread
* (???) --Meuuh */
vlc_thread_set_priority( p_intf, VLC_THREAD_PRIORITY_LOW );
[NSApp run];
}
/*****************************************************************************
* VLCApplication implementation
*****************************************************************************/
@implementation VLCApplication
- (NSString *)localizedString:(char *)psz
{
NSString * o_str = nil;
if( psz != NULL )
{
o_str = [[[NSString alloc] initWithUTF8String: psz] autorelease];
}
if ( o_str == NULL )
{
msg_Err( p_intf, "could not translate: %s", psz );
}
return( o_str );
}
- (char *)delocalizeString:(NSString *)id
{
NSData * o_data = [id dataUsingEncoding: NSUTF8StringEncoding
allowLossyConversion: NO];
char * psz_string;
if ( o_data == nil )
{
o_data = [id dataUsingEncoding: NSUTF8StringEncoding
allowLossyConversion: YES];
psz_string = malloc( [o_data length] + 1 );
[o_data getBytes: psz_string];
psz_string[ [o_data length] ] = '\0';
msg_Err( p_intf, "cannot convert to wanted encoding: %s",
psz_string );
}
else
{
psz_string = malloc( [o_data length] + 1 );
[o_data getBytes: psz_string];
psz_string[ [o_data length] ] = '\0';
}
return psz_string;
}
/* 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;
}
- (intf_thread_t *)getIntf
{
return( p_intf );
}
- (void)terminate:(id)sender
{
p_intf->p_vlc->b_die = VLC_TRUE;
[super terminate:sender];
}
/*****************************************************************************
* hasDefinedShortcutKey: Check to see if the key press is a defined VLC
* shortcut key. If it is, pass it off to VLC for handling and return YES,
* otherwise ignore it and return NO (where it will get handled by Cocoa).
*****************************************************************************/
- (BOOL)hasDefinedShortcutKey:(NSEvent *)o_event
{
unichar key = 0;
vlc_value_t val;
unsigned int i_pressed_modifiers = 0;
struct hotkey *p_hotkeys;
int i;
val.i_int = 0;
p_hotkeys = p_intf->p_vlc->p_hotkeys;
i_pressed_modifiers = [o_event modifierFlags];
if( i_pressed_modifiers & NSShiftKeyMask )
val.i_int |= KEY_MODIFIER_SHIFT;
if( i_pressed_modifiers & NSControlKeyMask )
val.i_int |= KEY_MODIFIER_CTRL;
if( i_pressed_modifiers & NSAlternateKeyMask )
val.i_int |= KEY_MODIFIER_ALT;
if( i_pressed_modifiers & NSCommandKeyMask )
val.i_int |= KEY_MODIFIER_COMMAND;
key = [[o_event charactersIgnoringModifiers] characterAtIndex: 0];
val.i_int |= CocoaKeyToVLC( key );
for( i = 0; p_hotkeys[i].psz_action != NULL; i++ )
{
if( p_hotkeys[i].i_key == val.i_int )
{
var_Set( p_intf->p_vlc, "key-pressed", val );
return YES;
}
}
return NO;
[NSBundle loadNibNamed: @"MainMenu" owner: NSApp];
}
@end
int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
{
int i_ret = 0;
......@@ -271,7 +115,7 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
withObject: [NSValue valueWithPointer: p_arg]
waitUntilDone: YES];
}
else if( NSApp != nil && [NSApp respondsToSelector: @selector(getIntf)] )
else if( NSApp != nil && [[VLCMain sharedInstance] respondsToSelector: @selector(getIntf)] )
{
NSValue * o_v1;
NSValue * o_v2;
......@@ -285,7 +129,7 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
id * val[] = { &o_lock, &o_v2 };
p_intf = (intf_thread_t *)[NSApp getIntf];
p_intf = (intf_thread_t *)VLCIntf;
o_recv_port = [[NSPort port] retain];
o_v1 = [NSValue valueWithPointer: val];
......@@ -329,7 +173,7 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param )
{
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
p_intf->p_sys->b_playlist_update = TRUE;
p_intf->p_sys->b_intf_update = TRUE;
return VLC_SUCCESS;
......@@ -417,10 +261,36 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key )
*****************************************************************************/
@implementation VLCMain
static VLCMain *_o_sharedMainInstance = nil;
+ (VLCMain *)sharedInstance
{
return _o_sharedMainInstance ? _o_sharedMainInstance : [[self alloc] init];
}
- (id)init
{
if (_o_sharedMainInstance) {
[self dealloc];
} else {
_o_sharedMainInstance = [super init];
}
return _o_sharedMainInstance;
}
- (void)setIntf: (intf_thread_t *)p_mainintf {
p_intf = p_mainintf;
}
- (intf_thread_t *)getIntf {
return p_intf;
}
- (void)awakeFromNib
{
unsigned int i_key = 0;
intf_thread_t * p_intf = [NSApp getIntf];
intf_thread_t * p_intf = VLCIntf;
playlist_t *p_playlist;
vlc_value_t val;
......@@ -632,8 +502,6 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key )
- (void)applicationWillFinishLaunching:(NSNotification *)o_notification
{
intf_thread_t * p_intf = [NSApp getIntf];
o_msg_lock = [[NSLock alloc] init];
o_msg_arr = [[NSMutableArray arrayWithCapacity: 200] retain];
......@@ -659,7 +527,7 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key )
vlc_thread_set_priority( p_intf, VLC_THREAD_PRIORITY_LOW );
}
/*
- (BOOL)application:(NSApplication *)o_app openFile:(NSString *)o_filename
{
NSDictionary *o_dic = [NSDictionary dictionaryWithObjectsAndKeys: o_filename, @"ITEM_URL", nil];
......@@ -668,6 +536,135 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key )
return( TRUE );
}
*/
- (NSString *)localizedString:(char *)psz
{
NSString * o_str = nil;
if( psz != NULL )
{
o_str = [[[NSString alloc] initWithUTF8String: psz] autorelease];
}
if ( o_str == NULL )
{
msg_Err( VLCIntf, "could not translate: %s", psz );
}
return( o_str );
}
- (char *)delocalizeString:(NSString *)id
{
NSData * o_data = [id dataUsingEncoding: NSUTF8StringEncoding
allowLossyConversion: NO];
char * psz_string;
if ( o_data == nil )
{
o_data = [id dataUsingEncoding: NSUTF8StringEncoding
allowLossyConversion: YES];
psz_string = malloc( [o_data length] + 1 );
[o_data getBytes: psz_string];
psz_string[ [o_data length] ] = '\0';
msg_Err( VLCIntf, "cannot convert to wanted encoding: %s",
psz_string );
}
else
{
psz_string = malloc( [o_data length] + 1 );
[o_data getBytes: psz_string];
psz_string[ [o_data length] ] = '\0';
}
return psz_string;
}
/* 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;