Search
lxdream.org :: lxdream/src/cocoaui/paths_osx.m :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/cocoaui/paths_osx.m
changeset 965:fc39a6608851
next1021:848db285a184
author nkeynes
date Thu Jan 15 07:21:34 2009 +0000 (15 years ago)
permissions -rw-r--r--
last change Add missed paths_osx.m from previous commit
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/cocoaui/paths_osx.m Thu Jan 15 07:21:34 2009 +0000
1.3 @@ -0,0 +1,49 @@
1.4 +/**
1.5 + * $Id: cocoaui.c 863 2008-09-06 05:21:57Z nkeynes $
1.6 + *
1.7 + * Cocoa builds need to use different paths from ordinary builds, since
1.8 + * the message catalogs, default config, etc are all bundle-relative.
1.9 + * Otherwise paths use the standard unix install paths
1.10 + *
1.11 + * Copyright (c) 2008 Nathan Keynes.
1.12 + *
1.13 + * This program is free software; you can redistribute it and/or modify
1.14 + * it under the terms of the GNU General Public License as published by
1.15 + * the Free Software Foundation; either version 2 of the License, or
1.16 + * (at your option) any later version.
1.17 + *
1.18 + * This program is distributed in the hope that it will be useful,
1.19 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.20 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.21 + * GNU General Public License for more details.
1.22 + */
1.23 +
1.24 +#include <string.h>
1.25 +
1.26 +#include "lxdream.h"
1.27 +
1.28 +#include <AppKit/AppKit.h>
1.29 +
1.30 +static char *bundle_resource_path = NULL;
1.31 +
1.32 +static char *get_bundle_resource_path()
1.33 +{
1.34 + if( bundle_resource_path == NULL ) {
1.35 + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
1.36 + NSString *resourcePath = [[NSBundle mainBundle] resourcePath];
1.37 + bundle_resource_path = strdup([resourcePath UTF8String]);
1.38 + [pool release];
1.39 + }
1.40 + return bundle_resource_path;
1.41 +}
1.42 +
1.43 +const char *get_sysconf_path()
1.44 +{
1.45 + return get_bundle_resource_path();
1.46 +}
1.47 +
1.48 +const char *get_locale_path()
1.49 +{
1.50 + return get_bundle_resource_path();
1.51 +}
1.52 +
.