diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-09-18 19:26:26 +0200 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-09-18 19:30:11 +0200 |
commit | af018f7e4fe90b058d45a8ff803af4dcf759a7ce (patch) | |
tree | 8f882aa5c55c79ca4d560117762e10effb690faf | |
parent | 1cb55cebf981af3983efbddccfeedc2b776ee5fd (diff) | |
download | mpv-af018f7e4fe90b058d45a8ff803af4dcf759a7ce.tar.bz2 mpv-af018f7e4fe90b058d45a8ff803af4dcf759a7ce.tar.xz |
macosx: move bundle path stuff to path-macosx.m
This makes the code uniform to how stuff was handled for Windows in 1cb55ceb.
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | mpvcore/path.c | 7 | ||||
-rw-r--r-- | osdep/macosx_bundle.h | 26 | ||||
-rw-r--r-- | osdep/path-macosx.m (renamed from osdep/macosx_bundle.m) | 14 | ||||
-rw-r--r-- | osdep/path.h | 7 |
5 files changed, 16 insertions, 40 deletions
@@ -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 diff --git a/mpvcore/path.c b/mpvcore/path.c index 73eee15567..647693fb05 100644 --- a/mpvcore/path.c +++ b/mpvcore/path.c @@ -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 diff --git a/osdep/macosx_bundle.h b/osdep/macosx_bundle.h deleted file mode 100644 index fbb3383ad5..0000000000 --- a/osdep/macosx_bundle.h +++ /dev/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 */ - diff --git a/osdep/macosx_bundle.m b/osdep/path-macosx.m index 3a1f3b5b0b..7446710ee5 100644 --- a/osdep/macosx_bundle.m +++ b/osdep/path-macosx.m @@ -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; } diff --git a/osdep/path.h b/osdep/path.h index 26b8cd344e..0a5091bc3d 100644 --- a/osdep/path.h +++ b/osdep/path.h @@ -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 |