summaryrefslogtreecommitdiff
path: root/glib/gwin32.h
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2013-01-14 15:11:10 -0500
committerRyan Lortie <desrt@desrt.ca>2013-01-15 14:08:02 -0500
commitb68856a7c63289ae00394dafd354aa716477b8bc (patch)
treed1ea938a7cccd6550eb323c52fa643a54991bb67 /glib/gwin32.h
parent83e5d169d6f0fd3d0427bc3599df8e777b275d9f (diff)
downloadglib-wip/win32-source-api.tar.gz
win32: add HANDLE equivalents of new fd APIswip/win32-source-api
Add support for adding HANDLEs to a GSource and add API for creating a new GSource from a single HANDLE.
Diffstat (limited to 'glib/gwin32.h')
-rw-r--r--glib/gwin32.h30
1 files changed, 29 insertions, 1 deletions
diff --git a/glib/gwin32.h b/glib/gwin32.h
index ae87a45d4..e7f693b74 100644
--- a/glib/gwin32.h
+++ b/glib/gwin32.h
@@ -31,7 +31,7 @@
#error "Only <glib.h> can be included directly."
#endif
-#include <glib/gtypes.h>
+#include <glib/gmain.h>
#ifdef G_PLATFORM_WIN32
@@ -128,6 +128,34 @@ gchar *g_win32_get_package_installation_subdirectory_utf8 (const gchar *package,
const gchar *dll_name,
const gchar *subdir);
+/**
+ * GWin32HandleSourceFunc:
+ * @handle: the HANDLE that triggered the event
+ * @user_data: user data passed to g_win32_handle_add()
+ *
+ * The type of functions to be called when a Windows HANDLE watch source
+ * triggers.
+ *
+ * Returns: %FALSE if the source should be removed
+ **/
+typedef gboolean (*GWin32HandleSourceFunc) (HANDLE handle,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_2_36
+GSource *g_win32_handle_source_new (HANDLE handle);
+
+GLIB_AVAILABLE_IN_2_36
+guint g_win32_handle_add_full (gint priority,
+ HANDLE handle,
+ GWin32HandleSourceFunc function,
+ gpointer user_data,
+ GDestroyNotify notify);
+
+GLIB_AVAILABLE_IN_2_36
+guint g_win32_handle_add (HANDLE handle,
+ GWin32HandleSourceFunc function,
+ gpointer user_data);
+
#endif /* G_OS_WIN32 */
#endif /* __G_WIN32_H__ */