~ubuntu-branches/ubuntu/utopic/vlc/utopic

« back to all changes in this revision

Viewing changes to modules/gui/macosx/misc.m

  • Committer: Package Import Robot
  • Author(s): Benjamin Drung
  • Date: 2012-02-18 01:29:48 UTC
  • mfrom: (1.1.45) (3.5.32 sid)
  • Revision ID: package-import@ubuntu.com-20120218012948-tvq9nhnfi98kra44
Tags: 2.0.0-1
* New upstream release (Closes: #499381, #573064, #624027, LP: #455825,
  #573775, #695882, #705151, #708448, #738381, #743581, #747757, #817924,
  #931083).
* Remove dropped mozilla-plugin-vlc, vlc-plugin-ggi, and vlc-plugin-svgalib.
  The Mozilla browser plug-in is now provided by a separate source tarball.
* Add new plugins to and remove dropped plugins from vlc-nox.
* Add new and remove dropped build dependencies:
  + libbluray-dev (for Blu-ray support)
  + libresid-builder-dev
  + libsamplerate0-dev
  + libsidplay2-dev
  + lbspeexdsp-dev
  + libxcb-composite0-dev
  - libgtk2.0-dev
  - xulrunner-dev
* vlc-plugin-fluidsynth depends on fluid-soundfont-gm or
  musescore-soundfont-gm for having a sound font for playing MIDI files.
* Drop all patches (they were either backported or accepted by upstream).
* Update symbols for libvlc5.
* Install plugins.dat instead of running vlc-cache-gen in postinst.
* Update minimum version of build dependencies.
* Change Build-Dependency from libupnp3-dev to unversioned libupnp-dev.
  (Closes: #656831)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * misc.m: code not specific to vlc
3
3
 *****************************************************************************
4
4
 * Copyright (C) 2003-2011 VLC authors and VideoLAN
5
 
 * $Id: 5bca42c45a291b1437f6ee7bd3e00738e9f4c260 $
 
5
 * $Id: 34fa00efc3bd2f2020447f0a1c354accf43dab14 $
6
6
 *
7
7
 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8
8
 *          Felix Paul Kühne <fkuehne at videolan dot org>
188
188
    self = [super initWithContentRect:contentRect styleMask:styleMask backing:backingType defer:flag];
189
189
    if( self )
190
190
    {
 
191
        b_isFullscreen = NO;
191
192
        b_isset_canBecomeKeyWindow = NO;
192
193
        /* we don't want this window to be restored on relaunch */
193
194
        if (OSX_LION)
361
362
    }
362
363
}
363
364
 
 
365
- (void)setFullscreen:(BOOL)b_var
 
366
{
 
367
    b_isFullscreen = b_var;
 
368
}
 
369
 
364
370
- (BOOL)isFullscreen
365
371
{
366
 
    return YES;
 
372
    return b_isFullscreen;
367
373
}
 
374
 
368
375
@end
369
376
 
370
377
/*****************************************************************************
418
425
            NSArray *o_values = [[o_paste propertyListForType: NSFilenamesPboardType] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
419
426
            NSUInteger count = [o_values count];
420
427
 
 
428
            input_thread_t * p_input = pl_CurrentInput( VLCIntf );
 
429
            BOOL b_returned = NO;
 
430
 
 
431
            if (count == 1 && p_input)
 
432
            {
 
433
                b_returned = input_AddSubtitle( p_input, make_URI([[o_values objectAtIndex:0] UTF8String], NULL), true );
 
434
                vlc_object_release( p_input );
 
435
                if(!b_returned)
 
436
                    return YES;
 
437
            }
 
438
            else if( p_input )
 
439
                vlc_object_release( p_input );
 
440
 
421
441
            for( NSUInteger i = 0; i < count; i++)
422
442
            {
423
443
                NSDictionary *o_dic;
505
525
            NSArray *o_values = [[o_paste propertyListForType: NSFilenamesPboardType] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
506
526
            NSUInteger count = [o_values count];
507
527
 
 
528
            input_thread_t * p_input = pl_CurrentInput( VLCIntf );
 
529
            BOOL b_returned = NO;
 
530
 
 
531
            if (count == 1 && p_input)
 
532
            {
 
533
                b_returned = input_AddSubtitle( p_input, make_URI([[o_values objectAtIndex:0] UTF8String], NULL), true );
 
534
                vlc_object_release( p_input );
 
535
                if(!b_returned)
 
536
                    return YES;
 
537
            }
 
538
            else if( p_input )
 
539
                vlc_object_release( p_input );
 
540
 
508
541
            for( NSUInteger i = 0; i < count; i++)
509
542
            {
510
543
                NSDictionary *o_dic;
720
753
    else
721
754
        o_string_color = [NSColor colorWithCalibratedRed:0.64 green:0.64 blue:0.64 alpha:100.0];
722
755
 
 
756
    textAlignment = NSCenterTextAlignment;
723
757
    o_string_attributes_dict = [[NSDictionary dictionaryWithObjectsAndKeys: o_string_color, NSForegroundColorAttributeName, [NSFont titleBarFontOfSize:10.0], NSFontAttributeName, nil] retain];
724
758
}
725
759
 
 
760
- (void)setAlignment:(NSTextAlignment)alignment
 
761
{
 
762
    textAlignment = alignment;
 
763
    [self setStringValue:[self stringValue]];
 
764
}
 
765
 
726
766
- (void)dealloc
727
767
{
728
768
    [o_string_shadow release];
743
783
    NSUInteger i_stringLength = [string length];
744
784
 
745
785
    [o_attributed_string addAttribute: NSShadowAttributeName value: o_string_shadow range: NSMakeRange(0, i_stringLength)];
746
 
    [o_attributed_string setAlignment: NSRightTextAlignment range: NSMakeRange(0, i_stringLength)];
 
786
    [o_attributed_string setAlignment: textAlignment range: NSMakeRange(0, i_stringLength)];
747
787
    [self setAttributedStringValue: o_attributed_string];
748
788
    [o_attributed_string release];
749
789
}
838
878
}
839
879
 
840
880
@end
 
881
 
 
882
@implementation VLCThreePartDropView
 
883
 
 
884
- (BOOL)mouseDownCanMoveWindow
 
885
{
 
886
    return YES;
 
887
}
 
888
 
 
889
- (void)dealloc
 
890
{
 
891
    [self unregisterDraggedTypes];
 
892
    [super dealloc];
 
893
}
 
894
 
 
895
- (void)awakeFromNib
 
896
{
 
897
    [self registerForDraggedTypes:[NSArray arrayWithObjects:NSTIFFPboardType,
 
898
                                   NSFilenamesPboardType, nil]];
 
899
}
 
900
 
 
901
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
 
902
{
 
903
    if ((NSDragOperationGeneric & [sender draggingSourceOperationMask])
 
904
        == NSDragOperationGeneric)
 
905
    {
 
906
        return NSDragOperationGeneric;
 
907
    }
 
908
    else
 
909
    {
 
910
        return NSDragOperationNone;
 
911
    }
 
912
}
 
913
 
 
914
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
 
915
{
 
916
    return YES;
 
917
}
 
918
 
 
919
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
 
920
{
 
921
    NSPasteboard *o_paste = [sender draggingPasteboard];
 
922
    NSArray *o_types = [NSArray arrayWithObjects: NSFilenamesPboardType, nil];
 
923
    NSString *o_desired_type = [o_paste availableTypeFromArray:o_types];
 
924
    NSData *o_carried_data = [o_paste dataForType:o_desired_type];
 
925
    BOOL b_autoplay = config_GetInt( VLCIntf, "macosx-autoplay" );
 
926
 
 
927
    if( o_carried_data )
 
928
    {
 
929
        if ([o_desired_type isEqualToString:NSFilenamesPboardType])
 
930
        {
 
931
            NSArray *o_array = [NSArray array];
 
932
            NSArray *o_values = [[o_paste propertyListForType: NSFilenamesPboardType] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
 
933
            NSUInteger count = [o_values count];
 
934
 
 
935
            input_thread_t * p_input = pl_CurrentInput( VLCIntf );
 
936
            BOOL b_returned = NO;
 
937
 
 
938
            if (count == 1 && p_input)
 
939
            {
 
940
                b_returned = input_AddSubtitle( p_input, make_URI([[o_values objectAtIndex:0] UTF8String], NULL), true );
 
941
                vlc_object_release( p_input );
 
942
                if(!b_returned)
 
943
                    return YES;
 
944
            }
 
945
            else if( p_input )
 
946
                vlc_object_release( p_input );
 
947
 
 
948
            for( NSUInteger i = 0; i < count; i++)
 
949
            {
 
950
                NSDictionary *o_dic;
 
951
                char *psz_uri = make_URI([[o_values objectAtIndex:i] UTF8String], NULL);
 
952
                if( !psz_uri )
 
953
                    continue;
 
954
 
 
955
                o_dic = [NSDictionary dictionaryWithObject:[NSString stringWithCString:psz_uri encoding:NSUTF8StringEncoding] forKey:@"ITEM_URL"];
 
956
                free( psz_uri );
 
957
 
 
958
                o_array = [o_array arrayByAddingObject: o_dic];
 
959
            }
 
960
            if( b_autoplay )
 
961
                [[[VLCMain sharedInstance] playlist] appendArray: o_array atPos: -1 enqueue:NO];
 
962
            else
 
963
                [[[VLCMain sharedInstance] playlist] appendArray: o_array atPos: -1 enqueue:YES];
 
964
            return YES;
 
965
        }
 
966
    }
 
967
    [self setNeedsDisplay:YES];
 
968
    return YES;
 
969
}
 
970
 
 
971
- (void)concludeDragOperation:(id <NSDraggingInfo>)sender
 
972
{
 
973
    [self setNeedsDisplay:YES];
 
974
}
 
975
 
 
976
@end