mirror of
https://github.com/gnustep/libs-back.git
synced 2025-02-23 20:01:22 +00:00
more unicode fixups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@24438 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
38f4377214
commit
26792908cf
3 changed files with 21 additions and 21 deletions
|
@ -34,10 +34,12 @@
|
|||
|
||||
- (NSMutableString *) dumpQue:(int)acount
|
||||
{
|
||||
NSMutableString * output=[NSMutableString stringWithCString:"Dumping "];
|
||||
|
||||
NSMutableString * output;
|
||||
int i=0;
|
||||
int c=[event_queue count];
|
||||
|
||||
output = [NSMutableString stringWithCapacity: 1024];
|
||||
[output appendString: @"Dumping "];
|
||||
if (acount >=c || acount==0)
|
||||
acount=c;
|
||||
else
|
||||
|
|
|
@ -1199,12 +1199,13 @@ printf("\n\n##############################################################\n");
|
|||
|
||||
- (NSString *) getNativeClassName: (HWND)hwnd
|
||||
{
|
||||
char * windowType[80];
|
||||
UINT wsize = 80;
|
||||
unichar windowType[wsize + 1];
|
||||
|
||||
if (RealGetWindowClass(hwnd,(LPTSTR)windowType,wsize)>0)
|
||||
if (RealGetWindowClassW(hwnd, windowType, wsize) > 0)
|
||||
{
|
||||
return [NSString stringWithCString: (char *)windowType length: wsize+1];
|
||||
return [NSString stringWithCharacters: windowType
|
||||
length: wcslen(windowType)];
|
||||
}
|
||||
|
||||
return nil;
|
||||
|
@ -1212,11 +1213,14 @@ printf("\n\n##############################################################\n");
|
|||
|
||||
- (NSString *) getWindowtext: (HWND)hwnd
|
||||
{
|
||||
char * windowText[80];
|
||||
int wsize = 80;
|
||||
unichar windowText[wsize + 1];
|
||||
|
||||
if (GetWindowText(hwnd,(LPTSTR)windowText,wsize) > 0)
|
||||
return [NSString stringWithCString: (char *)windowText length: wsize + 1];
|
||||
if (GetWindowTextW(hwnd, windowText, wsize) > 0)
|
||||
{
|
||||
return [NSString stringWithCharacters: windowText
|
||||
length: wcslen(windowText)];
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
|
|
@ -122,16 +122,14 @@ void add_font(NSMutableArray *fontDefs, NSString *fontName,
|
|||
else
|
||||
traits |= NSUnitalicFontMask;
|
||||
|
||||
fontStyle = [[NSString alloc] initWithBytes: lpelfe->elfStyle
|
||||
length: wcslen(lpelfe->elfStyle)
|
||||
encoding: NSUnicodeStringEncoding];
|
||||
fontStyle = [NSString stringWithCharacters: lpelfe->elfStyle
|
||||
length: wcslen(lpelfe->elfStyle)];
|
||||
fontDef = [NSArray arrayWithObjects:
|
||||
fontName,
|
||||
fontStyle,
|
||||
[NSNumber numberWithInt: weight],
|
||||
[NSNumber numberWithUnsignedInt: traits],
|
||||
nil];
|
||||
RELEASE(fontStyle);
|
||||
[fontDefs addObject: fontDef];
|
||||
}
|
||||
|
||||
|
@ -140,12 +138,10 @@ int CALLBACK fontenum(ENUMLOGFONTEXW *lpelfe, NEWTEXTMETRICEX *lpntme,
|
|||
{
|
||||
NSString *fontName;
|
||||
|
||||
fontName = [[NSString alloc] initWithBytes: lpelfe->elfFullName
|
||||
length: wcslen(lpelfe->elfFullName)
|
||||
encoding: NSUnicodeStringEncoding];
|
||||
fontName = [NSString stringWithCharacters: lpelfe->elfFullName
|
||||
length: wcslen(lpelfe->elfFullName)];
|
||||
NSLog(@"Found font %@", fontName);
|
||||
add_font((NSMutableArray *)lParam, fontName, lpelfe, lpntme);
|
||||
RELEASE(fontName);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -178,10 +174,8 @@ int CALLBACK fontfamilyenum(ENUMLOGFONTEXW *lpelfe, NEWTEXTMETRICEX *lpntme,
|
|||
NSMutableArray *fontDefs;
|
||||
WIN32FontEnumerator *enumer = (WIN32FontEnumerator*)lParam;
|
||||
|
||||
fontName = AUTORELEASE([[NSString alloc]
|
||||
initWithBytes: lpelfe->elfFullName
|
||||
length: wcslen(lpelfe->elfFullName)
|
||||
encoding: NSUnicodeStringEncoding]);
|
||||
fontName = [NSString stringWithCharacters: lpelfe->elfFullName
|
||||
length: wcslen(lpelfe->elfFullName)];
|
||||
|
||||
familyName = win32_font_family(fontName);
|
||||
fontDefs = [enumer->allFontFamilies objectForKey: familyName];
|
||||
|
|
Loading…
Reference in a new issue