After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 309466 - gdkcursor-win32.c: patch for gdk_cursor_get_image implementation
gdkcursor-win32.c: patch for gdk_cursor_get_image implementation
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
2.7.x
Other All
: Normal minor
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2005-07-04 18:32 UTC by Kazuki Iwamoto
Modified: 2005-07-14 15:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
implemented gdk_cursor_get_image (3.40 KB, patch)
2005-07-04 18:35 UTC, Kazuki Iwamoto
none Details | Review

Description Kazuki Iwamoto 2005-07-04 18:32:20 UTC
I implemented gdk_cursor_get_image function.
This code is from gtkfilesystemwin32.c.

Other information:
Comment 1 Kazuki Iwamoto 2005-07-04 18:35:28 UTC
Created attachment 48641 [details] [review]
implemented gdk_cursor_get_image
Comment 2 Tor Lillqvist 2005-07-05 15:15:44 UTC
Ah, gtkfilesystemwin32.c. I thought I had seen code to do that somewhere ;-) Thanks.
Comment 3 Tor Lillqvist 2005-07-05 16:39:14 UTC
BTW, the docs for GetIconInfo() specify that the hbmColor bitmap is optional,
and not present for black and white icons (cursors). Isn't this a problem with
the code? In that case, only the hbmMask is present, and contains two halves
(its height is twice the width): "the upper half is the icon AND bitmask and the
lower half is the icon XOR bitmask". (See _gdk_win32_data_to_wcursor() for code
that creates a cursor from and "and plane" and "xor plane".)

The code to create an GdkPixbuf from a HICON (or HCURSOR) shouldn't be
duplicated, of course, but factored out into a non-public _gdk_win32_whatever()
function, and gtkfilesystemwin32.c should then call that.

Will work on this and commit.
Comment 4 Hans Breuer 2005-07-05 22:28:25 UTC
Just nitpicking: to be exported from gdk it should not have the underscore 
prefix, so gdk_win32_whatever()
Comment 5 Tor Lillqvist 2005-07-05 22:33:47 UTC
Umm, but such a function is for libgtk's use only, so using an underscore prefix
would make that more obvious to people tempted to use it. But OK, we do have
precedences where such functions are suffixed with _libgtk_only instead, maybe
that makes it even more obvious.
Comment 6 Matthias Clasen 2005-07-06 02:10:22 UTC
an underscore prefix indicates a function that is not static, but also not
exported from the library, thus not available to gtk. Thats what the
_libgtk_only suffix is for: private interfaces between gdk and gtk
Comment 7 Tor Lillqvist 2005-07-14 15:54:35 UTC
Umm, yes, this is fixed now:

2005-07-06  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkcursor-win32.c:
	(gdk_win32_icon_to_pixbuf_libgtk_only): New function, code moved
	here from gtk/gtkfilesystemwin32.c:extract_icon().
	(gdk_cursor_get_image): Use
	gdk_win32_icon_to_pixbuf_libgtk_only().