代码拉取完成,页面将自动刷新
#include <AppKit/NSWindow.h>
#include <AppKit/NSScreen.h>
#include "lionsupport.h"
bool LionSupport::isLion()
{
NSString *string = [NSString string];
// this selector was added only in Lion. so we can check if it's responding, we are on Lion
return [string respondsToSelector:@selector(linguisticTagsInRange:scheme:options:orthography:tokenRanges:)];
}
void LionSupport::addFullscreen(MainWindow *window)
{
#if defined(MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if (isLion()) // checks if lion is running
{
NSView *nsview = (NSView *) window->winId();
NSWindow *nswindow = [nsview window];
[nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
}
#else
#warning No fullscreen support will be included in this build
#endif
}
bool LionSupport::isRetinaDisplay()
{
#if defined(MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
return( [ [ NSScreen mainScreen ] respondsToSelector:@selector( backingScaleFactor ) ]
&& [ [ NSScreen mainScreen ] backingScaleFactor ] > 1.5 );
#else
return false;
#endif
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。