~ubuntu-branches/ubuntu/vivid/mpv/vivid

« back to all changes in this revision

Viewing changes to osdep/macosx_application.m

  • Committer: Package Import Robot
  • Author(s): Logan Rosen
  • Date: 2014-12-22 19:08:25 UTC
  • mfrom: (28.1.3 vivid-proposed)
  • Revision ID: package-import@ubuntu.com-20141222190825-bdtz8aiwvv65wpmi
Tags: 0.7.2-1ubuntu1
debian/rules: Disable altivec on ppc64el again, as it FTBFS with it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
233
233
                   options:NSAnchoredSearch
234
234
                     range:NSMakeRange(0, [MPV_PROTOCOL length])];
235
235
 
 
236
    url = [url stringByRemovingPercentEncoding];
 
237
 
236
238
    self.files = @[url];
237
239
 
238
240
    if (self.willStopOnOpenEvent) {
329
331
    NSApp = mpv_shared_app();
330
332
    [NSApp setDelegate:NSApp];
331
333
    [NSApp initialize_menu];
332
 
    [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
 
334
 
 
335
    // Will be set to Regular from cocoa_common during UI creation so that we
 
336
    // don't create an icon when playing audio only files.
 
337
    [NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory];
333
338
 
334
339
    atexit_b(^{
335
340
        // Because activation policy has just been set to behave like a real
439
444
    }
440
445
}
441
446
 
442
 
static const char macosx_icon[] =
443
 
#include "osdep/macosx_icon.inc"
444
 
;
445
 
 
446
 
static void set_application_icon(NSApplication *app)
447
 
{
448
 
    NSData *icon_data = [NSData dataWithBytesNoCopy:(void *)macosx_icon
449
 
                                             length:sizeof(macosx_icon)
450
 
                                       freeWhenDone:NO];
451
 
    NSImage *icon = [[NSImage alloc] initWithData:icon_data];
452
 
    [app setApplicationIconImage:icon];
453
 
    [icon release];
454
 
    [icon_data release];
455
 
}
456
 
 
457
447
void macosx_finder_args_preinit(int *argc, char ***argv)
458
448
{
459
449
    Application *app = mpv_shared_app();
475
465
        *argc = cocoa_argc;
476
466
        *argv = cocoa_argv;
477
467
    } else {
478
 
        set_application_icon(app);
479
468
        for (int i = 0; i < *argc; i++ ) {
480
469
            NSString *arg = [NSString stringWithUTF8String:(*argv)[i]];
481
470
            [app.argumentsList addObject:arg];