当前位置: 首页>>代码示例>>C++>>正文


C++ CFBundleGetBundleWithIdentifier函数代码示例

本文整理汇总了C++中CFBundleGetBundleWithIdentifier函数的典型用法代码示例。如果您正苦于以下问题:C++ CFBundleGetBundleWithIdentifier函数的具体用法?C++ CFBundleGetBundleWithIdentifier怎么用?C++ CFBundleGetBundleWithIdentifier使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了CFBundleGetBundleWithIdentifier函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CFBundleGetBundleWithIdentifier

void HeadlessView::loadExtensions() {
    if (extensionsLoaded) {
        return;
    }

#ifdef MBGL_USE_CGL
    gl::InitializeExtensions([](const char * name) {
        static CFBundleRef framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl"));
        if (!framework) {
            throw std::runtime_error("Failed to load OpenGL framework.");
        }

        CFStringRef str = CFStringCreateWithCString(kCFAllocatorDefault, name, kCFStringEncodingASCII);
        void* symbol = CFBundleGetFunctionPointerForName(framework, str);
        CFRelease(str);

        return reinterpret_cast<gl::glProc>(symbol);
    });
#endif

#ifdef MBGL_USE_GLX
    gl::InitializeExtensions([](const char * name) {
        return glXGetProcAddress(reinterpret_cast<const GLubyte *>(name));
    });
#endif

    extensionsLoaded = true;
}
开发者ID:Dyziorek,项目名称:mapbox-gl-native,代码行数:28,代码来源:headless_view.cpp

示例2: GetHIToolboxVersion

long GetHIToolboxVersion(void)
{
	CFBundleRef	bundle;
	CFStringRef	versStr = nil;

	static unsigned long	version = 0;
  
	if (version != 0)
		return version;

	bundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.HIToolbox"));
	if (bundle)
		versStr = (CFStringRef) CFBundleGetValueForInfoDictionaryKey(bundle, CFSTR("CFBundleShortVersionString"));

	if (versStr && (CFGetTypeID(versStr) == CFStringGetTypeID()))
	{
		int		major = 0, minor = 0, bugfix = 0;
		char	sz[20];

		CFStringGetCString(versStr, sz, sizeof(sz), kCFStringEncodingUTF8);
		sscanf(sz, "%d.%d.%d", &major, &minor, &bugfix);
		version = (major << 8) + (minor << 4) + bugfix;
	}

	return version;
}
开发者ID:alesegdia,项目名称:snes-sdk,代码行数:26,代码来源:mac-dialog.cpp

示例3: _intlize

static_inline const char *
_intlize(const char *msg, int base, char *str, size_t len)
{
    char domain[12 +20];
    CFStringRef cfstring = CFStringCreateWithCString(kCFAllocatorSystemDefault,
						     msg,
						     kCFStringEncodingUTF8);
    CFStringRef cfdomain;
    CFBundleRef OpenAFSBundle = CFBundleGetBundleWithIdentifier(CFSTR("org.openafs.filesystems.afs"));

    if (!str) {
        CFRelease(cfstring);
	return msg;
    }

    snprintf(domain, sizeof(domain), "heim_com_err%d", base);
    cfdomain = CFStringCreateWithCString(kCFAllocatorSystemDefault, domain,
					 kCFStringEncodingUTF8);
    if (OpenAFSBundle != NULL) {
	CFStringRef cflocal;

	cflocal = CFBundleCopyLocalizedString(OpenAFSBundle, cfstring,
					      cfstring, cfdomain);
        CFStringGetCString(cflocal, str, len, kCFStringEncodingUTF8);
	CFRelease(cflocal);
    } else {
        CFStringGetCString(cfstring, str, len, kCFStringEncodingUTF8);
    }

    CFRelease(cfstring);
    CFRelease(cfdomain);
    return str;
}
开发者ID:jblaine,项目名称:openafs,代码行数:33,代码来源:error_msg.c

示例4: switch

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//	ÇPROJECTNAMEÈ::GetProperty
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ComponentResult		ÇPROJECTNAMEÈ::GetProperty(	AudioUnitPropertyID inID,
                                                        AudioUnitScope 		inScope,
                                                        AudioUnitElement 	inElement,
                                                        void *			outData )
{
if (inScope == kAudioUnitScope_Global) {
		switch (inID) {
			case kAudioUnitProperty_CocoaUI:
			{
				// Look for a resource in the main bundle by name and type.
				CFBundleRef bundle = CFBundleGetBundleWithIdentifier( CFSTR("com.Demo.audiounit.ÇPROJECTNAMEÈ") );
				
				if (bundle == NULL) return fnfErr;
                
				CFURLRef bundleURL = CFBundleCopyResourceURL( bundle, 
                    CFSTR("CocoaViewFactory"), 
                    CFSTR("bundle"), 
                    NULL);
                
                if (bundleURL == NULL) return fnfErr;
                
				CFStringRef className = CFSTR("CocoaViewFactory");
				AudioUnitCocoaViewInfo cocoaInfo = { bundleURL, className };
				*((AudioUnitCocoaViewInfo *)outData) = cocoaInfo;
				
				return noErr;
		}
	  }
	}

	return AUEffectBase::GetProperty (inID, inScope, inElement, outData);
}
开发者ID:fruitsamples,项目名称:AudioUnitEffectTemplates,代码行数:35,代码来源:StarterAU.cpp

示例5: AUBase

//_____________________________________________________________________________
//
AUPannerBase::AUPannerBase(AudioComponentInstance inAudioUnit)
    : AUBase(inAudioUnit, 1, 1), mBypassEffect(false)
{
	{
		CABundleLocker lock;
		if (!sLocalized)
		{		
			CFBundleRef bundle = CFBundleGetBundleWithIdentifier( CFSTR("com.apple.audio.units.Components") );
			if (bundle != NULL)
			{
				kPanner_Azimuth_Name 	= CFCopyLocalizedStringFromTableInBundle(kPanner_Azimuth_Name,    CFSTR("AudioUnits"), bundle, CFSTR(""));
				kPanner_Elevation_Name 	= CFCopyLocalizedStringFromTableInBundle(kPanner_Elevation_Name,  CFSTR("AudioUnits"), bundle, CFSTR(""));
				kPanner_Distance_Name 	= CFCopyLocalizedStringFromTableInBundle(kPanner_Distance_Name,   CFSTR("AudioUnits"), bundle, CFSTR(""));
				
				kPanner_CoordScale_Name  = CFCopyLocalizedStringFromTableInBundle(kPanner_CoordScale_Name,  CFSTR("AudioUnits"), bundle, CFSTR(""));
				kPanner_RefDistance_Name = CFCopyLocalizedStringFromTableInBundle(kPanner_RefDistance_Name, CFSTR("AudioUnits"), bundle, CFSTR(""));
				kPanner_Gain_Name 	     = CFCopyLocalizedStringFromTableInBundle(kPanner_Gain_Name,        CFSTR("AudioUnits"), bundle, CFSTR(""));

			}
			
			sLocalized = true;
		}
	}
	
	CreateElements();
	
    SetParameter(kPannerParam_Azimuth, kPannerParamDefault_Azimuth);
    SetParameter(kPannerParam_Elevation, kPannerParamDefault_Elevation);
    SetParameter(kPannerParam_Distance, kPannerParamDefault_Distance);
    
    SetParameter(kPannerParam_CoordScale, kPannerParamDefault_CoordScale);
    SetParameter(kPannerParam_RefDistance, kPannerParamDefault_RefDistance);
    SetParameter(kPannerParam_Gain, kPannerParamDefault_Gain);
}
开发者ID:0xJoker,项目名称:apple-ios-samples,代码行数:36,代码来源:AUPannerBase.cpp

示例6: AUEffectBase

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//	RadioEffectUnit::RadioEffectUnit
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RadioEffectUnit::RadioEffectUnit(AudioUnit Component)
	: AUEffectBase(Component)
{
	CreateElements();

	if (!bGLocalized) {		
		// Because we are in a component, we need to load our bundle by identifier so we can access our localized strings
		// It is important that the string passed here exactly matches that in the Info.plist Identifier string
		CFBundleRef bundle = CFBundleGetBundleWithIdentifier( CFSTR("com.epicgames.audiounit.radio") );
		
		if (bundle != NULL) {
			kChebyshevPowerMultiplierName = CFCopyLocalizedStringFromTableInBundle(kChebyshevPowerMultiplierName, CFSTR("Localizable"), bundle, CFSTR(""));
			kChebyshevPowerName = CFCopyLocalizedStringFromTableInBundle(kChebyshevPowerName, CFSTR("Localizable"), bundle, CFSTR(""));
			kChebyshevMultiplierName = CFCopyLocalizedStringFromTableInBundle(kChebyshevMultiplierName, CFSTR("Localizable"), bundle, CFSTR(""));	
			kChebyshevCubedMultiplierName = CFCopyLocalizedStringFromTableInBundle(kChebyshevCubedMultiplierName, CFSTR("Localizable"), bundle, CFSTR(""));	
		}
		bGLocalized = TRUE; //so never pass the test again...
	}

	GFinalBandPassFilter.Initialize( 2000.0f, 400.0f, GetSampleRate() );

	SetParameter(RadioParam_ChebyshevPowerMultiplier, 	kDefaultValue_ChebyshevPowerMultiplier );
	SetParameter(RadioParam_ChebyshevPower, 			kDefaultValue_ChebyshevPower );
	SetParameter(RadioParam_ChebyshevMultiplier, 		kDefaultValue_ChebyshevMultiplier );
	SetParameter(RadioParam_ChebyshevCubedMultiplier,	kDefaultValue_ChebyshevCubedMultiplier );
}
开发者ID:Art1stical,项目名称:AHRUnrealEngine,代码行数:30,代码来源:RadioEffectUnit.cpp

示例7: getFrameworkFromBundle

static string getFrameworkFromBundle()
{
	// Attempt to locate the Firebird.framework bundle
	CFBundleRef fbFramework = CFBundleGetBundleWithIdentifier(CFSTR(DARWIN_FRAMEWORK_ID));
	if (fbFramework)
	{
		CFURLRef msgFileUrl = CFBundleCopyResourceURL(fbFramework,
			CFSTR(DARWIN_GEN_DIR), NULL, NULL);
		if (msgFileUrl)
		{
			CFStringRef	msgFilePath = CFURLCopyFileSystemPath(msgFileUrl,
				kCFURLPOSIXPathStyle);
			if (msgFilePath)
			{
				char file_buff[MAXPATHLEN];
				if (CFStringGetCString(msgFilePath, file_buff, MAXPATHLEN,
					kCFStringEncodingMacRoman))
				{
					string dir = file_buff;
					dir += PathUtils::dir_sep;
					return dir;
				}
			}
		}
	}

	// No luck
	return "";
}
开发者ID:Alexpux,项目名称:firebird,代码行数:29,代码来源:config_root.cpp

示例8: CFBundleGetBundleWithIdentifier

void CAUGuiGraphic::loadImagePNG ( char* pngFileName )
{
	
	CFBundleRef bundleRef = CFBundleGetBundleWithIdentifier(CFSTR( AU_BUNDLE_IDENTIFIER ));
	CGDataProviderRef	provider;
	
	if ( bundleRef )
	{
		SInt16 tmp = CurResFile();
	
		CFStringRef fileName = ::CFStringCreateWithCString( NULL, pngFileName, kCFStringEncodingASCII );
		if ( fileName != NULL )
		{
			CFURLRef url = ::CFBundleCopyResourceURL( bundleRef, fileName, NULL, NULL );
			
			provider = CGDataProviderCreateWithURL( url );

			Image = CGImageCreateWithPNGDataProvider( provider, NULL, false,  kCGRenderingIntentDefault );
			
			CGDataProviderRelease( provider );
			CFRelease( url );
			CFRelease( fileName );
		}
		else
		{
			Image = NULL;
		}
		
		 UseResFile(tmp);
	}
	
}
开发者ID:talanis85,项目名称:EverySynth,代码行数:32,代码来源:CAUGuiTools.cpp

示例9: hu_XMLLoad

/*************************************************************************
 *
 * hu_XMLLoad( inResourceName, inResourceExtension )
 *
 * Purpose: Load a resource( XML ) file into a CFPropertyListRef
 *
 * Inputs: inResourceName		- name of the resource file
 *			inResourceExtension - extension of the resource file
 *
 * Returns: CFPropertyListRef - the data
 */
static CFPropertyListRef hu_XMLLoad(CFStringRef inResourceName, CFStringRef inResourceExtension) {
	CFURLRef resFileCFURLRef;
	CFPropertyListRef tCFPropertyListRef = NULL;
	
	// check the main (application) bundle
	resFileCFURLRef = CFBundleCopyResourceURL(CFBundleGetMainBundle(), inResourceName, inResourceExtension, NULL);
	
	if ( !resFileCFURLRef ) {
		// check this specific (HID_Utilities framework) bundle
		CFBundleRef tCFBundleRef = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.HID_Utilities"));
		if ( tCFBundleRef ) {
			resFileCFURLRef = CFBundleCopyResourceURL( tCFBundleRef, inResourceName, inResourceExtension, NULL );
		}
	}
	if ( !resFileCFURLRef ) {
		// check bundles already loaded or otherwise known to the current process
		CFArrayRef tCFArrayRef = CFBundleGetAllBundles();
		CFIndex idx, cnt = CFArrayGetCount(tCFArrayRef);
		for ( idx = 0; idx < cnt; idx++ ) {
			CFBundleRef tCFBundleRef = (CFBundleRef) CFArrayGetValueAtIndex(tCFArrayRef, idx) ;
			if ( tCFBundleRef ) {
				resFileCFURLRef = CFBundleCopyResourceURL( tCFBundleRef, inResourceName, inResourceExtension, NULL );
				if ( resFileCFURLRef ) {
					break;
				}
			}
		}
	}
	if ( resFileCFURLRef ) {
		tCFPropertyListRef = hu_LoadFromXMLFile(resFileCFURLRef);
		CFRelease(resFileCFURLRef);
	}
	
	return (tCFPropertyListRef);
}   // hu_XMLLoad
开发者ID:CarlKenner,项目名称:gz3doom,代码行数:46,代码来源:HID_Name_Lookup.c

示例10: uv__set_process_title

int uv__set_process_title(const char* title) {
#if TARGET_OS_IPHONE
  return -1;
#else
  typedef CFTypeRef (*LSGetCurrentApplicationASNType)(void);
  typedef OSStatus (*LSSetApplicationInformationItemType)(int,
                                                          CFTypeRef,
                                                          CFStringRef,
                                                          CFStringRef,
                                                          CFDictionaryRef*);
  CFBundleRef launch_services_bundle;
  LSGetCurrentApplicationASNType ls_get_current_application_asn;
  LSSetApplicationInformationItemType ls_set_application_information_item;
  CFStringRef* display_name_key;
  ProcessSerialNumber psn;
  CFTypeRef asn;
  CFStringRef display_name;
  OSStatus err;

  launch_services_bundle =
      CFBundleGetBundleWithIdentifier(CFSTR("com.apple.LaunchServices"));

  if (launch_services_bundle == NULL)
    return -1;

  ls_get_current_application_asn = (LSGetCurrentApplicationASNType)
      CFBundleGetFunctionPointerForName(launch_services_bundle,
                                        CFSTR("_LSGetCurrentApplicationASN"));

  if (ls_get_current_application_asn == NULL)
    return -1;

  ls_set_application_information_item = (LSSetApplicationInformationItemType)
      CFBundleGetFunctionPointerForName(launch_services_bundle,
                                        CFSTR("_LSSetApplicationInformationItem"));

  if (ls_set_application_information_item == NULL)
    return -1;

  display_name_key = CFBundleGetDataPointerForName(launch_services_bundle,
                                                   CFSTR("_kLSDisplayNameKey"));

  if (display_name_key == NULL || *display_name_key == NULL)
    return -1;

  /* Force the process manager to initialize. */
  GetCurrentProcess(&psn);

  display_name = CFStringCreateWithCString(NULL, title, kCFStringEncodingUTF8);
  asn = ls_get_current_application_asn();
  err = ls_set_application_information_item(-2,  /* Magic value. */
                                            asn,
                                            *display_name_key,
                                            display_name,
                                            NULL);

  return (err == noErr) ? 0 : -1;
#endif  /* !TARGET_OS_IPHONE */
}
开发者ID:2saki,项目名称:node,代码行数:59,代码来源:darwin-proctitle.c

示例11: GetCodecBundle

CFBundleRef GetCodecBundle()
{
	static CFBundleRef sAudioCodecBundle = 0;
	if (!sAudioCodecBundle)
	{
	#if TARGET_OS_WIN32
		sAudioCodecBundle = CFBundleGetBundleWithIdentifier(CFSTR(kCodecBundleID));
	#else
		sAudioCodecBundle = CFBundleGetBundleWithIdentifier(kCodecBundleID);
	#endif
		if (sAudioCodecBundle)
		{
			CFRetain(sAudioCodecBundle);
		}
	}
	return sAudioCodecBundle;
}
开发者ID:63n,项目名称:ardour,代码行数:17,代码来源:GetCodecBundle.cpp

示例12: htmlURLRef

String WebInspectorProxy::inspectorPageURL() const
{
    RetainPtr<CFURLRef> htmlURLRef(AdoptCF, CFBundleCopyResourceURL(CFBundleGetBundleWithIdentifier(CFSTR("com.apple.WebKit")), CFSTR("inspector"), CFSTR("html"), CFSTR("inspector")));
    if (!htmlURLRef)
        return String();

    return String(CFURLGetString(htmlURLRef.get()));
}
开发者ID:mcgrawp,项目名称:webkit-webcl,代码行数:8,代码来源:WebInspectorProxyWin.cpp

示例13: open_libgl

static void open_libgl(void)
{
    bundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengles")); // we are always linked to OpenGLES.framework statically, so it is already loaded and could be found by id
    assert(bundle != NULL);
    
    CFRetain(bundle);
    bundleURL = CFBundleCopyBundleURL(bundle);
}
开发者ID:OGRECave,项目名称:ogre,代码行数:8,代码来源:gles2w.c

示例14: GetCodecBundle

CFBundleRef GetCodecBundle()
{
	static CFBundleRef sAudioCodecBundle = 0;
	if (!sAudioCodecBundle) 
	{
	#ifdef _MSC_VER // QuickTime 6.4 and before is broken
		sAudioCodecBundle = CFBundleGetBundleWithIdentifier(CFSTR(kCodecBundleID));
	#else
		sAudioCodecBundle = CFBundleGetBundleWithIdentifier(kCodecBundleID);
	#endif
		if (sAudioCodecBundle)
		{
			CFRetain(sAudioCodecBundle);
		}
	}
	return sAudioCodecBundle;
}
开发者ID:JanX2,项目名称:Perian,代码行数:17,代码来源:GetCodecBundle.cpp

示例15: _glfwPlatformInit

int _glfwPlatformInit( void )
{
    struct timeval tv;
    UInt32 nullDummy = 0;

    _glfwWin.MacWindow = NULL;
    _glfwWin.AGLContext = NULL;
    _glfwWin.WindowFunctions = NULL;
    _glfwWin.MouseUPP = NULL;
    _glfwWin.CommandUPP = NULL;
    _glfwWin.KeyboardUPP = NULL;
    _glfwWin.WindowUPP = NULL;
    
    _glfwInput.Modifiers = 0;
    
    _glfwLibs.OpenGLFramework
        = CFBundleGetBundleWithIdentifier( CFSTR( "com.apple.opengl" ) );
    if( _glfwLibs.OpenGLFramework == NULL )
    {
        return GL_FALSE;
    }

    _glfwDesktopVideoMode = CGDisplayCurrentMode( kCGDirectMainDisplay );
    if( _glfwDesktopVideoMode == NULL )
    {
        return GL_FALSE;
    }

    _glfwInitThreads();

    if( !_glfwChangeToResourcesDirectory() )
    {
        return GL_FALSE;
    }

    if( !_glfwInstallEventHandlers() )
    {
    	_glfwPlatformTerminate();
        return GL_FALSE;
    }

    // Ugly hack to reduce the nasty jump that occurs at the first non-
    // sys keypress, caused by OS X loading certain meta scripts used
    // for lexical- and raw keycode translation - instead of letting
    // this happen while our application is running, we do some blunt
    // function calls in advance just to get the script caching out of
    // the way, BEFORE our window/screen is opened. These calls might
    // generate err return codes, but we don't care in this case.
    // NOTE: KCHRPtr is declared globally, because we need it later on.
    KCHRPtr = (void *)GetScriptVariable( smCurrentScript, smKCHRCache );
    KeyTranslate( KCHRPtr, 0, &nullDummy );
    UppercaseText( (char *)&nullDummy, 0, smSystemScript );

    gettimeofday( &tv, NULL );
    _glfwTimer.t0 = tv.tv_sec + (double) tv.tv_usec / 1000000.0;

    return GL_TRUE;
}
开发者ID:mmozeiko,项目名称:Squares3D,代码行数:58,代码来源:macosx_init.c


注:本文中的CFBundleGetBundleWithIdentifier函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。