gtk2/gdk/win32
Руслан Ижбулатов d8da6d38db GDK W32: New cursor class
Instead of now-unused GdkWin32Cursor class (a subclass of GdkCursor),
add a stand-alone GdkWin32HCursor class that is a wrapper around
HCURSOR handle.

On creation it's given a display instance, a HCURSOR handle and a boolean
that indicates whether the HCURSOR handle can or cannot be destroyed
(this depends on how the handle was obtained).
That information is stored in a hash table inside the GdkWin32Display
singleton, each entry of that table has reference count.
When the GdkWin32HCursor object is finalized, it reduces the reference
count on the table entry in the GdkWin32Display. When it's created,
it either adds such an entry or refs an existing one.
This way two pieces of code (or the same piece of code called
multiple times) that independently obtain the same HCURSOR from the OS
will get to different GdkWin32HCursor instances, but GdkWin32Display
will know that both use the same handle.

Once the reference count reaches 0 on the table entry, it is freed
and the handle (if destroyable) is put on the destruction list,
and an idle destruction function is queued.

If the same handle is once again registered for use before the
idle destructior is invoked (this happens, for example, when
an old cursor is destroyed and then replaced with a new one),
the handle gets removed from the destruction list.

The destructor just calls DestroyCursor() on each handle, calling
SetCursor(NULL) before doing that when the handle is in use.
This ensures that SetCursor(NULL) (which will cause cursor to disappear,
which is bad by itself, and which will also cause flickering if the
cursor is set to a non-NULL again shortly afterward)
is almost never called, unless GTK messes up and keeps using a cursor
beyond its lifetime.

This scheme also ensures that non-destructable cursors are not destroyed.

It's also possible to call _gdk_win32_display_hcursor_ref()
and _gdk_win32_display_hcursor_unref() manually instead of creating
GdkWin32HCursor objects, but that is not recommended.
2018-03-29 23:59:14 +00:00
..
rc
bdfcursor.c
cursor.bdf
gdkclipboard-win32.c GDK W32: gdk_content_formats_builder_free{,_to_formats} 2018-03-29 17:43:59 +00:00
gdkclipboard-win32.h GDK W32: Another massive clipboard and DnD update 2018-03-29 17:43:53 +00:00
gdkclipdrop-win32.c GDK W32: Another massive clipboard and DnD update 2018-03-29 17:43:53 +00:00
gdkclipdrop-win32.h GDK W32: Another massive clipboard and DnD update 2018-03-29 17:43:53 +00:00
gdkcursor-win32.c GDK W32: New cursor class 2018-03-29 23:59:14 +00:00
gdkdevice-virtual.c GdkSurface: Rename various functions and variables 2018-03-20 12:05:26 +01:00
gdkdevice-virtual.h
gdkdevice-win32.c GdkSurface: Rename various functions and variables 2018-03-20 12:05:26 +01:00
gdkdevice-win32.h GdkWindow -> GdkSurface initial type rename 2018-03-20 11:40:08 +01:00
gdkdevice-wintab.c GdkSurface: Rename various functions and variables 2018-03-20 12:05:26 +01:00
gdkdevice-wintab.h GdkWindow -> GdkSurface initial type rename 2018-03-20 11:40:08 +01:00
gdkdevicemanager-win32.c GDK W32: Adapt to the window->surface change 2018-03-29 17:44:00 +00:00
gdkdevicemanager-win32.h GdkWindow -> GdkSurface initial type rename 2018-03-20 11:40:08 +01:00
gdkdisplay-win32.c GDK W32: Adapt to event filter removal 2018-03-29 17:43:55 +00:00
gdkdisplay-win32.h GDK W32: New cursor class 2018-03-29 23:59:14 +00:00
gdkdisplaymanager-win32.c
gdkdnd-win32.c GDK W32: adapt to GdkDragProtocol removal 2018-03-29 17:43:54 +00:00
gdkdrag-win32.c GDK W32: Don't use gdk_threads_add_timeout_full() 2018-03-29 17:43:58 +00:00
gdkdrop-win32.c GDK W32: gdk_content_formats_builder_free{,_to_formats} 2018-03-29 17:43:59 +00:00
gdkevents-win32.c GDK W32: the .area member of the expose event is gone 2018-03-29 18:02:50 +00:00
gdkgeometry-win32.c GdkSurface: Rename various functions and variables 2018-03-20 12:05:26 +01:00
gdkglcontext-win32.c gdkglcontext-win32.c: Fix window->surface changes 2018-03-29 13:25:12 +08:00
gdkglcontext-win32.h GdkWindow -> GdkSurface: File renames 2018-03-20 11:46:11 +01:00
gdkglobals-win32.c GDK W32: Another massive clipboard and DnD update 2018-03-29 17:43:53 +00:00
gdkhdataoutputstream-win32.c GDK W32: Another massive clipboard and DnD update 2018-03-29 17:43:53 +00:00
gdkhdataoutputstream-win32.h GDK W32: Another massive clipboard and DnD update 2018-03-29 17:43:53 +00:00
gdkkeys-win32.c GDK W32: drop the use of gdk_keymap_get_default() 2018-03-28 16:10:38 +08:00
gdkmain-win32.c GDK W32: adapt to GdkDragProtocol removal 2018-03-29 17:43:54 +00:00
gdkmonitor-win32.c GdkSurface: Rename various functions and variables 2018-03-20 12:05:26 +01:00
gdkmonitor-win32.h
gdkprivate-win32.h GDK W32: New cursor class 2018-03-29 23:59:14 +00:00
gdkproperty-win32.c gdk: Remove properties 2017-12-14 03:05:34 +01:00
gdkscreen-win32.c GdkSurface: Rename various functions and variables 2018-03-20 12:05:26 +01:00
gdkselection-win32.c GDK W32: Adapt DnD event putting to recent changes 2018-03-24 10:59:02 +00:00
gdkselection-win32.h GdkWindow -> GdkSurface initial type rename 2018-03-20 11:40:08 +01:00
gdksurface-win32.c GDK W32: Adapt to the window->surface change 2018-03-29 17:44:00 +00:00
gdksurface-win32.h GDK W32: move GdkWin32MonitorDpiType to a different header 2018-03-28 08:33:07 +00:00
gdkvulkancontext-win32.c GdkSurface: Rename various functions and variables 2018-03-20 12:05:26 +01:00
gdkvulkancontext-win32.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkwin32.h GdkWindow -> GdkSurface: File renames 2018-03-20 11:46:11 +01:00
gdkwin32cursor.h GDK W32: New cursor class 2018-03-29 23:59:14 +00:00
gdkwin32display.h GDK W32: Adapt to event filter removal 2018-03-29 17:43:55 +00:00
gdkwin32displaymanager.h
gdkwin32dnd-private.h GDK W32: adapt to GdkDragProtocol removal 2018-03-29 17:43:54 +00:00
gdkwin32dnd.h GDK W32: Another massive clipboard and DnD update 2018-03-29 17:43:53 +00:00
gdkwin32glcontext.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkwin32id.c
gdkwin32keys.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkwin32misc.h Fix up indentation after GdkSurface rename 2018-03-21 09:06:31 +01:00
gdkwin32monitor.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkwin32screen.h
gdkwin32surface.h GdkWindow -> GdkSurface: File renames 2018-03-20 11:46:11 +01:00
libwntab32x.la
meson.build GDK W32: Another massive clipboard and DnD update 2018-03-29 17:43:53 +00:00
pktdef.h
wintab.h
xcursors.h