mirror of
https://github.com/gnustep/libs-back.git
synced 2025-05-31 17:31:33 +00:00
* Source/win32/w32_create.m (-decodeWM_CREATEParams:::): Call
windowbacking:: instead of handling backingstore here. Merge some changes from testplant branch * Source/win32/WIN32Server.m : Fix for fatal exceptions when a nil mouse event tried to post Patch by Jonathan Gillaspie <jonathan.gillaspie@testplant.com> * Source/gsc/GSGState.m (-description), * Source/cairo/CairoGState.m (-description): Add this method. * Headers/win32/WIN32Server.h - Added a mutable array for storing multiple screen information from GDI screen lookup * Source/win32/WIN32Server.m - Added startup sequence to invoke GDI functions to look up multiple screen/monitor information * Source/gsc/GSGState.m: Fix compiler warnings Patch by Marcian Lytwyn <marcian.lytwyn@advcsi.com> git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@35688 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d8dc387937
commit
6eb76f47f1
6 changed files with 169 additions and 47 deletions
17
ChangeLog
17
ChangeLog
|
@ -1,3 +1,20 @@
|
||||||
|
2012-10-14 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Source/win32/w32_create.m (-decodeWM_CREATEParams:::): Call
|
||||||
|
windowbacking:: instead of handling backingstore here.
|
||||||
|
Merge some changes from testplant branch
|
||||||
|
* Source/win32/WIN32Server.m : Fix for fatal exceptions when a nil
|
||||||
|
mouse event tried to post
|
||||||
|
Patch by Jonathan Gillaspie <jonathan.gillaspie@testplant.com>
|
||||||
|
* Source/gsc/GSGState.m (-description),
|
||||||
|
* Source/cairo/CairoGState.m (-description): Add this method.
|
||||||
|
* Headers/win32/WIN32Server.h - Added a mutable array for storing
|
||||||
|
multiple screen information from GDI screen lookup
|
||||||
|
* Source/win32/WIN32Server.m - Added startup sequence to invoke
|
||||||
|
GDI functions to look up multiple screen/monitor information
|
||||||
|
* Source/gsc/GSGState.m: Fix compiler warnings
|
||||||
|
Patch by Marcian Lytwyn <marcian.lytwyn@advcsi.com>
|
||||||
|
|
||||||
2012-09-28 Fred Kiefer <FredKiefer@gmx.de>
|
2012-09-28 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Source/gsc/GSStreamContext.m (-GSShowGlyphsWithAdvances:): Add
|
* Source/gsc/GSStreamContext.m (-GSShowGlyphsWithAdvances:): Add
|
||||||
|
|
|
@ -93,6 +93,7 @@ typedef struct w32serverFlags {
|
||||||
HWND desiredFocus;
|
HWND desiredFocus;
|
||||||
HWND currentActive;
|
HWND currentActive;
|
||||||
HICON currentAppIcon;
|
HICON currentAppIcon;
|
||||||
|
NSMutableArray *monitorInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) handlesWindowDecorations;
|
- (BOOL) handlesWindowDecorations;
|
||||||
|
|
|
@ -122,6 +122,12 @@ static inline float floatToUserSpace(NSAffineTransform *ctm, double d)
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString*) description
|
||||||
|
{
|
||||||
|
return [NSString stringWithFormat: @"%@ surface: %@ context: %p",
|
||||||
|
[super description], _surface, _ct];
|
||||||
|
}
|
||||||
|
|
||||||
- (id) copyWithZone: (NSZone *)zone
|
- (id) copyWithZone: (NSZone *)zone
|
||||||
{
|
{
|
||||||
CairoGState *copy = (CairoGState *)[super copyWithZone: zone];
|
CairoGState *copy = (CairoGState *)[super copyWithZone: zone];
|
||||||
|
@ -491,6 +497,7 @@ static inline float floatToUserSpace(NSAffineTransform *ctm, double d)
|
||||||
if (_ct)
|
if (_ct)
|
||||||
{
|
{
|
||||||
cairo_destroy(_ct);
|
cairo_destroy(_ct);
|
||||||
|
_ct = NULL;
|
||||||
}
|
}
|
||||||
if (!_surface)
|
if (!_surface)
|
||||||
{
|
{
|
||||||
|
|
|
@ -101,6 +101,12 @@
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString*) description
|
||||||
|
{
|
||||||
|
return [NSString stringWithFormat: @"%@ drawcontext: %@ ctm: %@",
|
||||||
|
[super description], drawcontext, ctm];
|
||||||
|
}
|
||||||
|
|
||||||
- copyWithZone: (NSZone *)zone
|
- copyWithZone: (NSZone *)zone
|
||||||
{
|
{
|
||||||
GSGState *new = (GSGState *)NSCopyObject(self, 0, zone);
|
GSGState *new = (GSGState *)NSCopyObject(self, 0, zone);
|
||||||
|
@ -299,7 +305,7 @@
|
||||||
{
|
{
|
||||||
device_color_t col;
|
device_color_t col;
|
||||||
|
|
||||||
ASSIGN(fillColorS, spaceref);
|
ASSIGN(fillColorS, (NSColorSpace*)spaceref);
|
||||||
gsMakeColor(&col, rgb_colorspace, 0, 0, 0, 0);
|
gsMakeColor(&col, rgb_colorspace, 0, 0, 0, 0);
|
||||||
// Keep the old alpha value
|
// Keep the old alpha value
|
||||||
col.field[AINDEX] = fillColor.field[AINDEX];
|
col.field[AINDEX] = fillColor.field[AINDEX];
|
||||||
|
@ -310,7 +316,7 @@
|
||||||
{
|
{
|
||||||
device_color_t col;
|
device_color_t col;
|
||||||
|
|
||||||
ASSIGN(strokeColorS, spaceref);
|
ASSIGN(strokeColorS, (NSColorSpace*)spaceref);
|
||||||
gsMakeColor(&col, rgb_colorspace, 0, 0, 0, 0);
|
gsMakeColor(&col, rgb_colorspace, 0, 0, 0, 0);
|
||||||
// Keep the old alpha value
|
// Keep the old alpha value
|
||||||
col.field[AINDEX] = fillColor.field[AINDEX];
|
col.field[AINDEX] = fillColor.field[AINDEX];
|
||||||
|
|
|
@ -75,6 +75,81 @@ static NSEvent *process_mouse_event(WIN32Server *svr,
|
||||||
LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg,
|
LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg,
|
||||||
WPARAM wParam, LPARAM lParam);
|
WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
|
@interface W32DisplayMonitorInfo : NSObject
|
||||||
|
{
|
||||||
|
HMONITOR _hMonitor;
|
||||||
|
RECT _rect;
|
||||||
|
NSRect _frame;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)initWithHMonitor:(HMONITOR)hMonitor rect:(LPRECT)lprcMonitor;
|
||||||
|
- (HMONITOR)hMonitor;
|
||||||
|
- (RECT)rect;
|
||||||
|
- (NSRect)frame;
|
||||||
|
- (void)setFrame:(NSRect)frame;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation W32DisplayMonitorInfo
|
||||||
|
|
||||||
|
- (id) initWithHMonitor: (HMONITOR)hMonitor rect: (LPRECT)lprcMonitor
|
||||||
|
{
|
||||||
|
self = [self init];
|
||||||
|
if (self)
|
||||||
|
{
|
||||||
|
CGFloat w = lprcMonitor->right - lprcMonitor->left;
|
||||||
|
CGFloat h = lprcMonitor->bottom - lprcMonitor->top;
|
||||||
|
CGFloat x = lprcMonitor->left;
|
||||||
|
CGFloat y = h - lprcMonitor->bottom;
|
||||||
|
_frame = NSMakeRect(x, y, w, h);
|
||||||
|
memcpy(&_rect, lprcMonitor, sizeof(RECT));
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (HMONITOR) hMonitor
|
||||||
|
{
|
||||||
|
return _hMonitor;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (RECT) rect
|
||||||
|
{
|
||||||
|
return _rect;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSRect) frame
|
||||||
|
{
|
||||||
|
return _frame;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setFrame: (NSRect)frame
|
||||||
|
{
|
||||||
|
_frame = frame;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
BOOL CALLBACK LoadDisplayMonitorInfo(HMONITOR hMonitor,
|
||||||
|
HDC hdcMonitor,
|
||||||
|
LPRECT lprcMonitor,
|
||||||
|
LPARAM dwData)
|
||||||
|
{
|
||||||
|
NSMutableArray *monitors = (NSMutableArray*)dwData;
|
||||||
|
W32DisplayMonitorInfo *info = [[W32DisplayMonitorInfo alloc]
|
||||||
|
initWithHMonitor: hMonitor
|
||||||
|
rect: lprcMonitor];
|
||||||
|
|
||||||
|
NSDebugLog(@"screen %ld:hdc: %ld frame:top:%ld left:%ld right:%ld bottom:%ld frame:x:%f y:%f w:%f h:%f\n",
|
||||||
|
[monitors count], (long)hMonitor,
|
||||||
|
lprcMonitor->top, lprcMonitor->left,
|
||||||
|
lprcMonitor->right, lprcMonitor->bottom,
|
||||||
|
[info frame].origin.x, [info frame].origin.y,
|
||||||
|
[info frame].size.width, [info frame].size.height);
|
||||||
|
[monitors addObject:info];
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
@implementation WIN32Server
|
@implementation WIN32Server
|
||||||
|
|
||||||
- (BOOL) handlesWindowDecorations
|
- (BOOL) handlesWindowDecorations
|
||||||
|
@ -258,6 +333,9 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg,
|
||||||
[self _initWin32Context];
|
[self _initWin32Context];
|
||||||
[super initWithAttributes: info];
|
[super initWithAttributes: info];
|
||||||
|
|
||||||
|
monitorInfo = [NSMutableArray array];
|
||||||
|
EnumDisplayMonitors(NULL, NULL, (MONITORENUMPROC)LoadDisplayMonitorInfo, (LPARAM)monitorInfo);
|
||||||
|
|
||||||
[self setupRunLoopInputSourcesForMode: NSDefaultRunLoopMode];
|
[self setupRunLoopInputSourcesForMode: NSDefaultRunLoopMode];
|
||||||
[self setupRunLoopInputSourcesForMode: NSConnectionReplyMode];
|
[self setupRunLoopInputSourcesForMode: NSConnectionReplyMode];
|
||||||
[self setupRunLoopInputSourcesForMode: NSModalPanelRunLoopMode];
|
[self setupRunLoopInputSourcesForMode: NSModalPanelRunLoopMode];
|
||||||
|
@ -294,7 +372,7 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg,
|
||||||
if ([defs objectForKey: @"GSBackUsesNativeTaskbar"])
|
if ([defs objectForKey: @"GSBackUsesNativeTaskbar"])
|
||||||
{
|
{
|
||||||
[self setUsesNativeTaskbar:
|
[self setUsesNativeTaskbar:
|
||||||
[defs boolForKey: @"GSUseNativeTaskbar"]];
|
[defs boolForKey: @"GSBackUsesNativeTaskbar"]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -375,20 +453,35 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg,
|
||||||
|
|
||||||
- (NSRect) boundsForScreen: (int)screen
|
- (NSRect) boundsForScreen: (int)screen
|
||||||
{
|
{
|
||||||
return NSMakeRect(0, 0, GetSystemMetrics(SM_CXSCREEN),
|
if (screen < [monitorInfo count])
|
||||||
GetSystemMetrics(SM_CYSCREEN));
|
{
|
||||||
|
return [[monitorInfo objectAtIndex:screen] frame];
|
||||||
|
}
|
||||||
|
return NSZeroRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSWindowDepth) windowDepthForScreen: (int)screen
|
- (NSWindowDepth) windowDepthForScreen: (int)screen
|
||||||
{
|
{
|
||||||
HDC hdc;
|
HDC hdc = 0;
|
||||||
int bits;
|
int bits = 0;
|
||||||
//int planes;
|
//int planes;
|
||||||
|
|
||||||
hdc = GetDC(NULL);
|
if (screen < [monitorInfo count])
|
||||||
bits = GetDeviceCaps(hdc, BITSPIXEL) / 3;
|
{
|
||||||
//planes = GetDeviceCaps(hdc, PLANES);
|
MONITORINFOEX mix = { 0 };
|
||||||
//NSLog(@"bits %d planes %d", bits, planes);
|
mix.cbSize = sizeof(MONITORINFOEX);
|
||||||
|
HMONITOR hMonitor = [[monitorInfo objectAtIndex: screen] hMonitor];
|
||||||
|
|
||||||
|
if (GetMonitorInfo(hMonitor, (LPMONITORINFO)&mix))
|
||||||
|
{
|
||||||
|
hdc = CreateDC("DISPLAY", mix.szDevice, NULL, NULL);
|
||||||
|
bits = GetDeviceCaps(hdc, BITSPIXEL) / 3;
|
||||||
|
//planes = GetDeviceCaps(hdc, PLANES);
|
||||||
|
//NSLog(@"bits %d planes %d", bits, planes);
|
||||||
|
ReleaseDC(NULL, hdc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ReleaseDC(NULL, hdc);
|
ReleaseDC(NULL, hdc);
|
||||||
|
|
||||||
return (_GSRGBBitValue | bits);
|
return (_GSRGBBitValue | bits);
|
||||||
|
@ -410,7 +503,15 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg,
|
||||||
|
|
||||||
- (NSArray *) screenList
|
- (NSArray *) screenList
|
||||||
{
|
{
|
||||||
return [NSArray arrayWithObject: [NSNumber numberWithInt: 0]];
|
NSInteger index;
|
||||||
|
NSInteger nMonitors = [monitorInfo count];
|
||||||
|
NSMutableArray *screenList = [NSMutableArray arrayWithCapacity: nMonitors];
|
||||||
|
|
||||||
|
for (index = 0; index < nMonitors; ++index)
|
||||||
|
{
|
||||||
|
[screenList addObject: [NSNumber numberWithInt: index]];
|
||||||
|
}
|
||||||
|
return [[screenList copy] autorelease];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2014,7 +2115,8 @@ process_mouse_event(WIN32Server *svr, HWND hwnd, WPARAM wParam, LPARAM lParam,
|
||||||
{
|
{
|
||||||
e = process_mouse_event(svr, hwnd, wParam, lParam,
|
e = process_mouse_event(svr, hwnd, wParam, lParam,
|
||||||
NSLeftMouseDown, uMsg);
|
NSLeftMouseDown, uMsg);
|
||||||
[GSCurrentServer() postEvent: e atStart: NO];
|
if (e != nil)
|
||||||
|
[GSCurrentServer() postEvent: e atStart: NO];
|
||||||
}
|
}
|
||||||
eventType = NSLeftMouseDragged;
|
eventType = NSLeftMouseDragged;
|
||||||
}
|
}
|
||||||
|
@ -2024,13 +2126,15 @@ process_mouse_event(WIN32Server *svr, HWND hwnd, WPARAM wParam, LPARAM lParam,
|
||||||
{
|
{
|
||||||
e = process_mouse_event(svr, hwnd, wParam, lParam,
|
e = process_mouse_event(svr, hwnd, wParam, lParam,
|
||||||
NSLeftMouseUp, uMsg);
|
NSLeftMouseUp, uMsg);
|
||||||
[GSCurrentServer() postEvent: e atStart: NO];
|
if (e != nil)
|
||||||
|
[GSCurrentServer() postEvent: e atStart: NO];
|
||||||
}
|
}
|
||||||
if (rDown == NO)
|
if (rDown == NO)
|
||||||
{
|
{
|
||||||
e = process_mouse_event(svr, hwnd, wParam, lParam,
|
e = process_mouse_event(svr, hwnd, wParam, lParam,
|
||||||
NSRightMouseDown, uMsg);
|
NSRightMouseDown, uMsg);
|
||||||
[GSCurrentServer() postEvent: e atStart: NO];
|
if (e != nil)
|
||||||
|
[GSCurrentServer() postEvent: e atStart: NO];
|
||||||
}
|
}
|
||||||
eventType = NSRightMouseDragged;
|
eventType = NSRightMouseDragged;
|
||||||
}
|
}
|
||||||
|
@ -2040,19 +2144,22 @@ process_mouse_event(WIN32Server *svr, HWND hwnd, WPARAM wParam, LPARAM lParam,
|
||||||
{
|
{
|
||||||
e = process_mouse_event(svr, hwnd, wParam, lParam,
|
e = process_mouse_event(svr, hwnd, wParam, lParam,
|
||||||
NSLeftMouseUp, uMsg);
|
NSLeftMouseUp, uMsg);
|
||||||
[GSCurrentServer() postEvent: e atStart: NO];
|
if (e != nil)
|
||||||
|
[GSCurrentServer() postEvent: e atStart: NO];
|
||||||
}
|
}
|
||||||
if (rDown == YES)
|
if (rDown == YES)
|
||||||
{
|
{
|
||||||
e = process_mouse_event(svr, hwnd, wParam, lParam,
|
e = process_mouse_event(svr, hwnd, wParam, lParam,
|
||||||
NSRightMouseUp, uMsg);
|
NSRightMouseUp, uMsg);
|
||||||
[GSCurrentServer() postEvent: e atStart: NO];
|
if (e != nil)
|
||||||
|
[GSCurrentServer() postEvent: e atStart: NO];
|
||||||
}
|
}
|
||||||
if (oDown == NO)
|
if (oDown == NO)
|
||||||
{
|
{
|
||||||
e = process_mouse_event(svr, hwnd, wParam, lParam,
|
e = process_mouse_event(svr, hwnd, wParam, lParam,
|
||||||
NSOtherMouseDown, uMsg);
|
NSOtherMouseDown, uMsg);
|
||||||
[GSCurrentServer() postEvent: e atStart: NO];
|
if (e != nil)
|
||||||
|
[GSCurrentServer() postEvent: e atStart: NO];
|
||||||
}
|
}
|
||||||
eventType = NSOtherMouseDragged;
|
eventType = NSOtherMouseDragged;
|
||||||
}
|
}
|
||||||
|
@ -2062,19 +2169,22 @@ process_mouse_event(WIN32Server *svr, HWND hwnd, WPARAM wParam, LPARAM lParam,
|
||||||
{
|
{
|
||||||
e = process_mouse_event(svr, hwnd, wParam, lParam,
|
e = process_mouse_event(svr, hwnd, wParam, lParam,
|
||||||
NSLeftMouseUp, uMsg);
|
NSLeftMouseUp, uMsg);
|
||||||
[GSCurrentServer() postEvent: e atStart: NO];
|
if (e != nil)
|
||||||
|
[GSCurrentServer() postEvent: e atStart: NO];
|
||||||
}
|
}
|
||||||
if (rDown == YES)
|
if (rDown == YES)
|
||||||
{
|
{
|
||||||
e = process_mouse_event(svr, hwnd, wParam, lParam,
|
e = process_mouse_event(svr, hwnd, wParam, lParam,
|
||||||
NSRightMouseUp, uMsg);
|
NSRightMouseUp, uMsg);
|
||||||
[GSCurrentServer() postEvent: e atStart: NO];
|
if (e != nil)
|
||||||
|
[GSCurrentServer() postEvent: e atStart: NO];
|
||||||
}
|
}
|
||||||
if (oDown == YES)
|
if (oDown == YES)
|
||||||
{
|
{
|
||||||
e = process_mouse_event(svr, hwnd, wParam, lParam,
|
e = process_mouse_event(svr, hwnd, wParam, lParam,
|
||||||
NSOtherMouseUp, uMsg);
|
NSOtherMouseUp, uMsg);
|
||||||
[GSCurrentServer() postEvent: e atStart: NO];
|
if (e != nil)
|
||||||
|
[GSCurrentServer() postEvent: e atStart: NO];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,42 +56,23 @@
|
||||||
is stored in the extra fields for this window. Drawing operations
|
is stored in the extra fields for this window. Drawing operations
|
||||||
work on this buffer. */
|
work on this buffer. */
|
||||||
win = malloc(sizeof(WIN_INTERN));
|
win = malloc(sizeof(WIN_INTERN));
|
||||||
|
memset(win, 0, sizeof(WIN_INTERN));
|
||||||
|
win->useHDC = NO;
|
||||||
SetWindowLong(hwnd, GWL_USERDATA, (int)win);
|
SetWindowLong(hwnd, GWL_USERDATA, (int)win);
|
||||||
|
|
||||||
if (type != NSBackingStoreNonretained)
|
|
||||||
{
|
|
||||||
HDC hdc, hdc2;
|
|
||||||
HBITMAP hbitmap;
|
|
||||||
RECT r;
|
|
||||||
|
|
||||||
GetClientRect((HWND)hwnd, &r);
|
[self windowbacking: type : (int)hwnd];
|
||||||
hdc = GetDC(hwnd);
|
|
||||||
hdc2 = CreateCompatibleDC(hdc);
|
|
||||||
hbitmap = CreateCompatibleBitmap(hdc, r.right - r.left,
|
|
||||||
r.bottom - r.top);
|
|
||||||
win->old = SelectObject(hdc2, hbitmap);
|
|
||||||
|
|
||||||
win->hdc = hdc2;
|
|
||||||
win->useHDC = YES;
|
|
||||||
|
|
||||||
ReleaseDC(hwnd, hdc);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
win->useHDC = NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Find the icon file, assume it has the same name as the "icon" which
|
// Find the icon file, assume it has the same name as the "icon" which
|
||||||
// was specified in the bundle's dictionary...
|
// was specified in the bundle's dictionary...
|
||||||
iconName = [[bundle infoDictionary] objectForKey: @"NSIcon"];
|
iconName = [[bundle infoDictionary] objectForKey: @"NSIcon"];
|
||||||
if(iconName == nil)
|
if (iconName == nil)
|
||||||
{
|
{
|
||||||
iconName = [[bundle infoDictionary]
|
iconName = [[bundle infoDictionary]
|
||||||
objectForKey: @"CFBundleIconFile"];
|
objectForKey: @"CFBundleIconFile"];
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the icon name is set, get the path...
|
// If the icon name is set, get the path...
|
||||||
if(iconName != nil)
|
if (iconName != nil)
|
||||||
{
|
{
|
||||||
iconName = [iconName stringByDeletingPathExtension];
|
iconName = [iconName stringByDeletingPathExtension];
|
||||||
iconPath = [[NSBundle mainBundle] pathForResource: iconName
|
iconPath = [[NSBundle mainBundle] pathForResource: iconName
|
||||||
|
@ -101,7 +82,7 @@
|
||||||
|
|
||||||
// If the path is set, load the icon file and set it as the
|
// If the path is set, load the icon file and set it as the
|
||||||
// icon on the window.
|
// icon on the window.
|
||||||
if(iconPath != nil)
|
if (iconPath != nil)
|
||||||
{
|
{
|
||||||
HICON icon = NULL;
|
HICON icon = NULL;
|
||||||
const char *cpath = [iconPath cString];
|
const char *cpath = [iconPath cString];
|
||||||
|
@ -110,7 +91,7 @@
|
||||||
cpath,
|
cpath,
|
||||||
IMAGE_ICON,0,0,
|
IMAGE_ICON,0,0,
|
||||||
LR_DEFAULTSIZE|LR_LOADFROMFILE);
|
LR_DEFAULTSIZE|LR_LOADFROMFILE);
|
||||||
SetClassLongPtr(hwnd,GCLP_HICON,(LONG_PTR)icon);
|
SetClassLongPtr(hwnd,GCLP_HICON, (LONG_PTR)icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue