mirror of
https://github.com/gnustep/libs-back.git
synced 2025-02-23 11:51:27 +00:00
Implement the ne cursor backend methods.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@32180 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f85e6a7f1d
commit
5125141980
3 changed files with 51 additions and 8 deletions
|
@ -1,3 +1,9 @@
|
|||
2011-02-15 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/win32/WIN32Server.m,
|
||||
* Source/x11/XGServerWindow.m: New methods for cursor
|
||||
handling. Requires corresponding gui change.
|
||||
|
||||
2011-02-14 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/x11/XGServerWindow.m (-orderwindow:::): Omit app icons
|
||||
|
|
|
@ -1638,7 +1638,7 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg,
|
|||
*/
|
||||
}
|
||||
|
||||
- (void) setcursorcolor: (NSColor *)fg : (NSColor *)bg : (void*) cid
|
||||
- (void) recolorcursor: (NSColor *)fg : (NSColor *)bg : (void*) cid
|
||||
{
|
||||
/* FIXME The colour is currently ignored
|
||||
if (fg != nil)
|
||||
|
@ -1651,10 +1651,19 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg,
|
|||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
- (void) setcursor: (void*) cid
|
||||
{
|
||||
SetCursor((HCURSOR)cid);
|
||||
}
|
||||
|
||||
- (void) freecursor: (void*) cid
|
||||
{
|
||||
// This is only allowed on non-shared cursors and we have no way of knowing that.
|
||||
//DestroyCursor((HCURSOR)cid);
|
||||
}
|
||||
|
||||
- (void) setParentWindow: (int)parentWin
|
||||
forChildWindow: (int)childWin
|
||||
{
|
||||
|
|
|
@ -4191,25 +4191,25 @@ xgps_cursor_image(Display *xdpy, Drawable draw, const unsigned char *data,
|
|||
*cid = (void *)cursor;
|
||||
}
|
||||
|
||||
- (void) setcursorcolor: (NSColor *)fg : (NSColor *)bg : (void*) cid
|
||||
- (void) recolorcursor: (NSColor *)fg : (NSColor *)bg : (void*) cid
|
||||
{
|
||||
XColor xf, xb;
|
||||
Cursor cursor;
|
||||
|
||||
cursor = (Cursor)cid;
|
||||
if (cursor == None)
|
||||
NSLog(@"Invalidparam: Invalid cursor");
|
||||
|
||||
[self _DPSsetcursor: cursor : YES];
|
||||
/* Special hack: Don't set the color when fg == nil. Used by NSCursor
|
||||
to just set the cursor but not the color. */
|
||||
if (fg == nil)
|
||||
{
|
||||
NSLog(@"Invalidparam: Invalid cursor");
|
||||
return;
|
||||
}
|
||||
|
||||
fg = [fg colorUsingColorSpaceName: NSDeviceRGBColorSpace];
|
||||
bg = [bg colorUsingColorSpaceName: NSDeviceRGBColorSpace];
|
||||
if (fg == nil || bg == nil)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
xf.red = 65535 * [fg redComponent];
|
||||
xf.green = 65535 * [fg greenComponent];
|
||||
xf.blue = 65535 * [fg blueComponent];
|
||||
|
@ -4222,6 +4222,34 @@ xgps_cursor_image(Display *xdpy, Drawable draw, const unsigned char *data,
|
|||
XRecolorCursor(dpy, cursor, &xf, &xb);
|
||||
}
|
||||
|
||||
- (void) setcursor: (void*) cid
|
||||
{
|
||||
Cursor cursor;
|
||||
|
||||
cursor = (Cursor)cid;
|
||||
if (cursor == None)
|
||||
{
|
||||
NSLog(@"Invalidparam: Invalid cursor");
|
||||
return;
|
||||
}
|
||||
|
||||
[self _DPSsetcursor: cursor : YES];
|
||||
}
|
||||
|
||||
- (void) freecursor: (void*) cid
|
||||
{
|
||||
Cursor cursor;
|
||||
|
||||
cursor = (Cursor)cid;
|
||||
if (cursor == None)
|
||||
{
|
||||
NSLog(@"Invalidparam: Invalid cursor");
|
||||
return;
|
||||
}
|
||||
|
||||
XFreeCursor(dpy, cursor);
|
||||
}
|
||||
|
||||
static NSWindowDepth
|
||||
_computeDepth(int class, int bpp)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue