Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
2ab3471c
Commit
2ab3471c
authored
Jun 11, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using utf8 string to keyboard languages
parent
c988c2c0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
186 additions
and
185 deletions
+186
-185
UBPlatformUtils_mac.mm
src/frameworks/UBPlatformUtils_mac.mm
+186
-185
No files found.
src/frameworks/UBPlatformUtils_mac.mm
View file @
2ab3471c
...
...
@@ -373,10 +373,10 @@ QPixmap qpixmapFromIconRef(IconRef iconRef, int size) {
HLock(hRawBitmapData);
unsigned long* data = (unsigned long*) *hRawBitmapData;
for (int posy=0; posy<iconSize; ++posy, data+=iconSize) {
#ifdef __BIG_ENDIAN__
#ifdef __BIG_ENDIAN__
uchar* line = image.scanLine(posy);
memcpy(line, data, iconSize * 4);
#else
#else
uchar* src = (uchar*) data;
uchar* dst = image.scanLine(posy);
for (int posx=0; posx<iconSize; src+=4, dst+=4, ++posx) {
...
...
@@ -385,7 +385,7 @@ QPixmap qpixmapFromIconRef(IconRef iconRef, int size) {
dst[2] = src[1];
dst[3] = src[0];
}
#endif
#endif
}
HUnlock(hRawBitmapData);
DisposeHandle( hRawBitmapData );
...
...
@@ -413,7 +413,7 @@ KEYBT* createKeyBt(const UCKeyboardLayout* keyLayout, int vkk)
UInt32 deadKeyState = 0L;
UInt32 kbdType = kKeyboardISO;
UniCharCount cnt1, cnt2
, cnt3
;
UniCharCount cnt1, cnt2;
UniChar unicodeString1[100], unicodeString2[100], unicodeString3[100];
UCKeyTranslate(keyLayout, vkk, kUCKeyActionDisplay, 0, kbdType, kUCKeyTranslateNoDeadKeysBit, &deadKeyState, 100, &cnt1, unicodeString1);
...
...
@@ -421,11 +421,12 @@ KEYBT* createKeyBt(const UCKeyboardLayout* keyLayout, int vkk)
UCKeyTranslate(keyLayout, vkk, kUCKeyActionDisplay, (alphaLock >> 8) & 0xff, kbdType, kUCKeyTranslateNoDeadKeysBit, &deadKeyState, 100, &cnt2, unicodeString3);
return new KEYBT(unicodeString1[0], unicodeString2[0], unicodeString1[0] != unicodeString3[0], 0,0, KEYCODE(0, vkk, 0), KEYCODE(0, vkk, 1));
}
}
void UBPlatformUtils::initializeKeyboardLayouts()
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
CFStringRef keys[] = { kTISPropertyInputSourceCategory, kTISPropertyInputSourceIsEnableCapable, kTISPropertyInputSourceIsSelectCapable };
const void* values[] = { kTISCategoryKeyboardInputSource, kCFBooleanTrue, kCFBooleanTrue };
CFDictionaryRef dict = CFDictionaryCreate(NULL, (const void **)keys, (const void **)values, 3, NULL, NULL);
...
...
@@ -506,7 +507,7 @@ void UBPlatformUtils::initializeKeyboardLayouts()
QString ID = QStringFromStringRef(sr);
sr = (CFStringRef) TISGetInputSourceProperty(keyLayoutRef, kTISPropertyLocalizedName);
QString fullName = QStringFromStringRef(sr
);
QString fullName = QString::fromUtf8([sr UTF8String], strlen([sr UTF8String])
);
CFArrayRef langs = (CFArrayRef) TISGetInputSourceProperty(keyLayoutRef, kTISPropertyInputSourceLanguages);
...
...
@@ -539,7 +540,7 @@ void UBPlatformUtils::initializeKeyboardLayouts()
for(int i=0; i<nKeyboardLayouts; i++)
keyboardLayouts[i] = result[i];
}
[pool drain];
}
void UBPlatformUtils::destroyKeyboardLayouts()
...
...
@@ -548,7 +549,7 @@ void UBPlatformUtils::destroyKeyboardLayouts()
QString UBPlatformUtils::urlFromClipboard()
{
QString qsRet;
/*
/*
// commented because Sankore crashes on Java Script. It seems to backends dependencies.
NSPasteboard* pPasteboard = [NSPasteboard pasteboardWithName:@"Apple CFPasteboard drag"];
WebArchive* pArchive = [[WebArchive alloc] initWithData:[pPasteboard dataForType:@"com.apple.webarchive"]];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment