|
|
@ -369,10 +369,10 @@ QPixmap qpixmapFromIconRef(IconRef iconRef, int size) { |
|
|
|
HLock(hRawBitmapData); |
|
|
|
HLock(hRawBitmapData); |
|
|
|
unsigned long* data = (unsigned long*) *hRawBitmapData; |
|
|
|
unsigned long* data = (unsigned long*) *hRawBitmapData; |
|
|
|
for (int posy=0; posy<iconSize; ++posy, data+=iconSize) { |
|
|
|
for (int posy=0; posy<iconSize; ++posy, data+=iconSize) { |
|
|
|
#ifdef __BIG_ENDIAN__ |
|
|
|
#ifdef __BIG_ENDIAN__ |
|
|
|
uchar* line = image.scanLine(posy); |
|
|
|
uchar* line = image.scanLine(posy); |
|
|
|
memcpy(line, data, iconSize * 4); |
|
|
|
memcpy(line, data, iconSize * 4); |
|
|
|
#else |
|
|
|
#else |
|
|
|
uchar* src = (uchar*) data; |
|
|
|
uchar* src = (uchar*) data; |
|
|
|
uchar* dst = image.scanLine(posy); |
|
|
|
uchar* dst = image.scanLine(posy); |
|
|
|
for (int posx=0; posx<iconSize; src+=4, dst+=4, ++posx) { |
|
|
|
for (int posx=0; posx<iconSize; src+=4, dst+=4, ++posx) { |
|
|
@ -381,7 +381,7 @@ QPixmap qpixmapFromIconRef(IconRef iconRef, int size) { |
|
|
|
dst[2] = src[1]; |
|
|
|
dst[2] = src[1]; |
|
|
|
dst[3] = src[0]; |
|
|
|
dst[3] = src[0]; |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
HUnlock(hRawBitmapData); |
|
|
|
HUnlock(hRawBitmapData); |
|
|
|
DisposeHandle( hRawBitmapData ); |
|
|
|
DisposeHandle( hRawBitmapData ); |
|
|
@ -421,6 +421,7 @@ KEYBT* createKeyBt(const UCKeyboardLayout* keyLayout, int vkk) |
|
|
|
|
|
|
|
|
|
|
|
void UBPlatformUtils::initializeKeyboardLayouts() |
|
|
|
void UBPlatformUtils::initializeKeyboardLayouts() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; |
|
|
|
CFStringRef keys[] = { kTISPropertyInputSourceCategory, kTISPropertyInputSourceIsEnableCapable, kTISPropertyInputSourceIsSelectCapable }; |
|
|
|
CFStringRef keys[] = { kTISPropertyInputSourceCategory, kTISPropertyInputSourceIsEnableCapable, kTISPropertyInputSourceIsSelectCapable }; |
|
|
|
const void* values[] = { kTISCategoryKeyboardInputSource, kCFBooleanTrue, kCFBooleanTrue }; |
|
|
|
const void* values[] = { kTISCategoryKeyboardInputSource, kCFBooleanTrue, kCFBooleanTrue }; |
|
|
|
CFDictionaryRef dict = CFDictionaryCreate(NULL, (const void **)keys, (const void **)values, 3, NULL, NULL); |
|
|
|
CFDictionaryRef dict = CFDictionaryCreate(NULL, (const void **)keys, (const void **)values, 3, NULL, NULL); |
|
|
@ -501,7 +502,7 @@ void UBPlatformUtils::initializeKeyboardLayouts() |
|
|
|
QString ID = QStringFromStringRef(sr); |
|
|
|
QString ID = QStringFromStringRef(sr); |
|
|
|
|
|
|
|
|
|
|
|
sr = (CFStringRef) TISGetInputSourceProperty(keyLayoutRef, kTISPropertyLocalizedName); |
|
|
|
sr = (CFStringRef) TISGetInputSourceProperty(keyLayoutRef, kTISPropertyLocalizedName); |
|
|
|
QString fullName = QStringFromStringRef(sr); |
|
|
|
QString fullName = QString::fromUtf8([sr UTF8String], strlen([sr UTF8String])); |
|
|
|
|
|
|
|
|
|
|
|
CFArrayRef langs = (CFArrayRef) TISGetInputSourceProperty(keyLayoutRef, kTISPropertyInputSourceLanguages); |
|
|
|
CFArrayRef langs = (CFArrayRef) TISGetInputSourceProperty(keyLayoutRef, kTISPropertyInputSourceLanguages); |
|
|
|
|
|
|
|
|
|
|
@ -534,7 +535,7 @@ void UBPlatformUtils::initializeKeyboardLayouts() |
|
|
|
for(int i=0; i<nKeyboardLayouts; i++) |
|
|
|
for(int i=0; i<nKeyboardLayouts; i++) |
|
|
|
keyboardLayouts[i] = result[i]; |
|
|
|
keyboardLayouts[i] = result[i]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[pool drain]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBPlatformUtils::destroyKeyboardLayouts() |
|
|
|
void UBPlatformUtils::destroyKeyboardLayouts() |
|
|
|