mirror of https://github.com/mpv-player/mpv
macosx: move bundle path stuff to path-macosx.m
This makes the code uniform to how stuff was handled for Windows in 1cb55ceb
.
This commit is contained in:
parent
1cb55cebf9
commit
af018f7e4f
2
Makefile
2
Makefile
|
@ -45,7 +45,7 @@ SOURCES-$(LIBPOSTPROC) += video/filter/vf_pp.c
|
|||
SOURCES-$(LIBSMBCLIENT) += stream/stream_smb.c
|
||||
|
||||
SOURCES-$(COCOA) += video/out/cocoa_common.m \
|
||||
osdep/macosx_bundle.m \
|
||||
osdep/path-macosx.m \
|
||||
osdep/macosx_application.m \
|
||||
osdep/macosx_events.m \
|
||||
osdep/ar/HIDRemote.m
|
||||
|
|
|
@ -39,16 +39,11 @@
|
|||
#include "osdep/io.h"
|
||||
#include "osdep/path.h"
|
||||
|
||||
#ifdef CONFIG_COCOA
|
||||
#include "osdep/macosx_bundle.h"
|
||||
#endif
|
||||
|
||||
|
||||
typedef char *(*lookup_fun)(const char *);
|
||||
static const lookup_fun config_lookup_functions[] = {
|
||||
mp_find_user_config_file,
|
||||
#ifdef CONFIG_COCOA
|
||||
get_bundled_path,
|
||||
mp_get_macosx_bundled_path,
|
||||
#endif
|
||||
mp_find_global_config_file,
|
||||
NULL
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* This file is part of mpv.
|
||||
*
|
||||
* mpv is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* mpv is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with mpv; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef MPV_MACOSX_BUNDLE
|
||||
#define MPV_MACOSX_BUNDLE
|
||||
|
||||
// Returns absolute path of a resource file in a Mac OS X application bundle.
|
||||
char *get_bundled_path(const char *filename);
|
||||
|
||||
#endif /* MPV_MACOSX_BUNDLE */
|
||||
|
|
@ -17,14 +17,14 @@
|
|||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#include "osdep/macosx_bundle.h"
|
||||
#include "mpvcore/path.h"
|
||||
#include "osdep/path.h"
|
||||
|
||||
char *get_bundled_path(const char *file)
|
||||
char *mp_get_macosx_bundled_path(const char *file)
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSString *path = [[NSBundle mainBundle] resourcePath];
|
||||
char *rv = mp_path_join(NULL, bstr0([path UTF8String]), bstr0(file));
|
||||
[pool release];
|
||||
return rv;
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSString *path = [[NSBundle mainBundle] resourcePath];
|
||||
char *rv = mp_path_join(NULL, bstr0([path UTF8String]), bstr0(file));
|
||||
[pool release];
|
||||
return rv;
|
||||
}
|
|
@ -1,8 +1,15 @@
|
|||
#ifndef OSDEP_PATH_H
|
||||
#define OSDEP_PATH_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
char *mp_get_win_config_path(const char *filename);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_COCOA
|
||||
// Returns absolute path of a resource file in a Mac OS X application bundle.
|
||||
char *mp_get_macosx_bundled_path(const char *filename);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue