]> git.lyx.org Git - lyx.git/blobdiff - src/support/Path.cpp
Add quote style information to languages
[lyx.git] / src / support / Path.cpp
index 3bdf22ed0f11deb68a234738684e728b3226038b..36837f6f9a06e2f530c0316f3f93db18d38813cc 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -63,4 +63,30 @@ int PathChanger::pop()
 
 
 #define PathChanger(x) unnamed_PathChanger;
+
+#ifdef __APPLE__
+
+#include <CoreServices/CoreServices.h>
+
+int getPrivateFrameworkPathName(char * buf, unsigned len, char const * framework)
+{
+       // Get our application's main bundle from Core Foundation
+       CFBundleRef myAppsBundle = CFBundleGetMainBundle();
+       int result = 0 ;
+       if (NULL != myAppsBundle) {
+               CFURLRef baseURL = CFBundleCopyPrivateFrameworksURL( myAppsBundle );
+               if (NULL != baseURL) {
+                       CFURLRef bundleURL = CFURLCreateCopyAppendingPathComponent( kCFAllocatorSystemDefault, baseURL,
+                               CFStringCreateWithCString( kCFAllocatorSystemDefault, framework, CFStringGetSystemEncoding() ),
+                               false );
+                       if (NULL != bundleURL) {
+                               result = CFURLGetFileSystemRepresentation( bundleURL, TRUE, (UInt8*)buf, len );
+                       }
+               }
+       }
+       return result;
+}
+
+#endif
+
 // in merged builds this is not the last line.