summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2000-12-05 20:53:30 +0000
committerOwen Taylor <otaylor@src.gnome.org>2000-12-05 20:53:30 +0000
commita4b2a6a857cea010ed0c2a16097bae61ad31c510 (patch)
tree4ef3004d65f13bada7cef4be302f8dd6550e242d /gdk
parent691576eb4087b87608d65d349e6f3bba608c74d5 (diff)
downloadgtk+-a4b2a6a857cea010ed0c2a16097bae61ad31c510.tar.gz
Fix link to PNG home, remove reference to fribidi.
Tue Dec 5 15:49:31 2000 Owen Taylor <otaylor@redhat.com> * INSTALL: Fix link to PNG home, remove reference to fribidi. * gdk/x11/gdkevents-x11.c: Fix up for new GMain API. * gdk/win32/gdkevents-win32.c: Fix up for new GMain API. (Not tested.) * gtk/gtkcheckmenuitem.c: Permanently turn on always_show_toggle. * gtk/gtkclist.c (gtk_clist_get_pixtext): Allow mask to be NULL. (Vladimir Klebanov, #26545) * gtk/gtkspinbutton.c (gtk_spin_button_insert_text): Fix some signed/unsigned comparison problems. (#6510, David Kaelbling) * gtk/gtkwidget.[ch] (gtk_widget_is_ancestor): Change return type to boolean (Oskar Liljeblad, #18648)
Diffstat (limited to 'gdk')
-rw-r--r--gdk/win32/gdkevents-win32.c49
-rw-r--r--gdk/x11/gdkevents-x11.c46
2 files changed, 46 insertions, 49 deletions
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index a4d66c33d2..bbebeed360 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -94,16 +94,13 @@ static gboolean gdk_event_translate (GdkEvent *event,
MSG *msg,
gboolean *ret_val_flagp,
gint *ret_valp);
-static gboolean gdk_event_prepare (gpointer source_data,
- GTimeVal *current_time,
- gint *timeout,
- gpointer user_data);
-static gboolean gdk_event_check (gpointer source_data,
- GTimeVal *current_time,
- gpointer user_data);
-static gboolean gdk_event_dispatch (gpointer source_data,
- GTimeVal *current_time,
- gpointer user_data);
+
+static gboolean gdk_event_prepare (GSource *source,
+ gint *timeout);
+static gboolean gdk_event_check (GSource *source);
+static gboolean gdk_event_dispatch (GSource *source,
+ GSourceFunc callback,
+ gpointer user_data);
/* Private variable declarations
*/
@@ -290,6 +287,7 @@ gdk_window_procedure (HWND hwnd,
void
gdk_events_init (void)
{
+ GSource *source;
HRESULT hres;
#ifdef USE_TRACKMOUSEEVENT
HMODULE user32, imm32;
@@ -307,12 +305,17 @@ gdk_events_init (void)
msh_mousewheel_msg = RegisterWindowMessage ("MSWHEEL_ROLLMSG");
GDK_NOTE (EVENTS, g_print ("MSH_MOUSEWHEEL = %#x\n", msh_mousewheel_msg));
- g_source_add (GDK_PRIORITY_EVENTS, TRUE, &event_funcs, NULL, NULL, NULL);
+ source = g_source_new (&event_funcs, sizeof (GSource));
+ g_source_set_priority (source, GDK_PRIORITY_EVENTS);
event_poll_fd.fd = G_WIN32_MSG_HANDLE;
event_poll_fd.events = G_IO_IN;
- g_main_add_poll (&event_poll_fd, GDK_PRIORITY_EVENTS);
+ g_source_add_poll (source, &event_poll_fd);
+ g_source_set_can_recurse (source, TRUE);
+ g_source_attach (source, NULL);
+
+ g_source_add (GDK_PRIORITY_EVENTS, TRUE, &event_funcs, NULL, NULL, NULL);
hres = CoCreateInstance (&CLSID_CActiveIMM,
NULL,
@@ -2836,11 +2839,9 @@ gdk_events_queue (void)
}
}
-static gboolean
-gdk_event_prepare (gpointer source_data,
- GTimeVal *current_time,
- gint *timeout,
- gpointer user_data)
+static gboolean
+gdk_event_prepare (GSource *source,
+ gint *timeout)
{
MSG msg;
gboolean retval;
@@ -2857,10 +2858,8 @@ gdk_event_prepare (gpointer source_data,
return retval;
}
-static gboolean
-gdk_event_check (gpointer source_data,
- GTimeVal *current_time,
- gpointer user_data)
+static gboolean
+gdk_event_check (GSource *source)
{
MSG msg;
gboolean retval;
@@ -2878,10 +2877,10 @@ gdk_event_check (gpointer source_data,
return retval;
}
-static gboolean
-gdk_event_dispatch (gpointer source_data,
- GTimeVal *current_time,
- gpointer user_data)
+static gboolean
+gdk_event_dispatch (GSource *source,
+ GSourceFunc callback,
+ gpointer user_data)
{
GdkEvent *event;
diff --git a/gdk/x11/gdkevents-x11.c b/gdk/x11/gdkevents-x11.c
index 59de87bc9b..afd843deda 100644
--- a/gdk/x11/gdkevents-x11.c
+++ b/gdk/x11/gdkevents-x11.c
@@ -86,16 +86,12 @@ static Bool gdk_event_get_type (Display *display,
XPointer arg);
#endif
-static gboolean gdk_event_prepare (gpointer source_data,
- GTimeVal *current_time,
- gint *timeout,
- gpointer user_data);
-static gboolean gdk_event_check (gpointer source_data,
- GTimeVal *current_time,
- gpointer user_data);
-static gboolean gdk_event_dispatch (gpointer source_data,
- GTimeVal *current_time,
- gpointer user_data);
+static gboolean gdk_event_prepare (GSource *source,
+ gint *timeout);
+static gboolean gdk_event_check (GSource *source);
+static gboolean gdk_event_dispatch (GSource *source,
+ GSourceFunc callback,
+ gpointer user_data);
GdkFilterReturn gdk_wm_protocols_filter (GdkXEvent *xev,
GdkEvent *event,
@@ -116,7 +112,7 @@ static GSourceFuncs event_funcs = {
gdk_event_prepare,
gdk_event_check,
gdk_event_dispatch,
- (GDestroyNotify)g_free
+ NULL
};
GPollFD event_poll_fd;
@@ -128,16 +124,22 @@ GPollFD event_poll_fd;
void
gdk_events_init (void)
{
+ GSource *source;
+
connection_number = ConnectionNumber (gdk_display);
GDK_NOTE (MISC,
g_message ("connection number: %d", connection_number));
- g_source_add (GDK_PRIORITY_EVENTS, TRUE, &event_funcs, NULL, NULL, NULL);
+ source = g_source_new (&event_funcs, sizeof (GSource));
+ g_source_set_priority (source, GDK_PRIORITY_EVENTS);
+
event_poll_fd.fd = connection_number;
event_poll_fd.events = G_IO_IN;
- g_main_add_poll (&event_poll_fd, GDK_PRIORITY_EVENTS);
+ g_source_add_poll (source, &event_poll_fd);
+ g_source_set_can_recurse (source, TRUE);
+ g_source_attach (source, NULL);
gdk_add_client_message_filter (gdk_wm_protocols,
gdk_wm_protocols_filter, NULL);
@@ -1281,7 +1283,7 @@ gdk_events_queue (void)
w = GDK_WINDOW_XWINDOW (gdk_xim_window);
break;
}
-
+
if (XFilterEvent (&xevent, w))
continue;
#else
@@ -1313,10 +1315,8 @@ gdk_events_queue (void)
}
static gboolean
-gdk_event_prepare (gpointer source_data,
- GTimeVal *current_time,
- gint *timeout,
- gpointer user_data)
+gdk_event_prepare (GSource *source,
+ gint *timeout)
{
gboolean retval;
@@ -1332,9 +1332,7 @@ gdk_event_prepare (gpointer source_data,
}
static gboolean
-gdk_event_check (gpointer source_data,
- GTimeVal *current_time,
- gpointer user_data)
+gdk_event_check (GSource *source)
{
gboolean retval;
@@ -1351,9 +1349,9 @@ gdk_event_check (gpointer source_data,
}
static gboolean
-gdk_event_dispatch (gpointer source_data,
- GTimeVal *current_time,
- gpointer user_data)
+gdk_event_dispatch (GSource *source,
+ GSourceFunc callback,
+ gpointer user_data)
{
GdkEvent *event;