From 2e96cb67cedf3ab723f670b10731d06d1f0384b4 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 21 Jul 2005 13:20:06 +0000 Subject: gtk/gtkxembed.h New function, used in error messages and debugging output. 2005-07-21 Tor Lillqvist * gtk/gtkxembed.h * gtk/gtkxembed.c (_gtk_xembed_message_name): New function, used in error messages and debugging output. --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkxembed.c | 30 +++++++++++++++++++++++++++++- gtk/gtkxembed.h | 9 +++++---- 5 files changed, 52 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 633c81ab2..86e695a0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-07-21 Tor Lillqvist + + * gtk/gtkxembed.h + * gtk/gtkxembed.c (_gtk_xembed_message_name): New function, used + in error messages and debugging output. + 2005-07-21 Tor Lillqvist * gdk/win32/gdkwindow-win32.c (gdk_window_set_title): Use diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 633c81ab2..86e695a0e 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2005-07-21 Tor Lillqvist + + * gtk/gtkxembed.h + * gtk/gtkxembed.c (_gtk_xembed_message_name): New function, used + in error messages and debugging output. + 2005-07-21 Tor Lillqvist * gdk/win32/gdkwindow-win32.c (gdk_window_set_title): Use diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 633c81ab2..86e695a0e 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +2005-07-21 Tor Lillqvist + + * gtk/gtkxembed.h + * gtk/gtkxembed.c (_gtk_xembed_message_name): New function, used + in error messages and debugging output. + 2005-07-21 Tor Lillqvist * gdk/win32/gdkwindow-win32.c (gdk_window_set_title): Use diff --git a/gtk/gtkxembed.c b/gtk/gtkxembed.c index 4d084f140..164b4c2bb 100644 --- a/gtk/gtkxembed.c +++ b/gtk/gtkxembed.c @@ -149,7 +149,7 @@ _gtk_xembed_send_message (GdkWindow *recipient, display = gdk_drawable_get_display (recipient); GTK_NOTE (PLUGSOCKET, - g_message ("Sending XEMBED message of type %d", message)); + g_message ("Sending %s", _gtk_xembed_message_name (message))); xevent.xclient.window = GDK_WINDOW_XWINDOW (recipient); xevent.xclient.type = ClientMessage; @@ -213,3 +213,31 @@ _gtk_xembed_send_focus_message (GdkWindow *recipient, _gtk_xembed_send_message (recipient, message, detail, flags, 0); } +const char * +_gtk_xembed_message_name (XEmbedMessageType message) +{ + static char unk[100]; + + switch (message) + { +#define CASE(x) case XEMBED_##x: return "XEMBED_"#x + CASE (EMBEDDED_NOTIFY); + CASE (WINDOW_ACTIVATE); + CASE (WINDOW_DEACTIVATE); + CASE (REQUEST_FOCUS); + CASE (FOCUS_IN); + CASE (FOCUS_OUT); + CASE (FOCUS_NEXT); + CASE (FOCUS_PREV); + CASE (GRAB_KEY); + CASE (UNGRAB_KEY); + CASE (MODALITY_ON); + CASE (MODALITY_OFF); + CASE (GTK_GRAB_KEY); + CASE (GTK_UNGRAB_KEY); +#undef CASE + default: + sprintf (unk, "UNKNOWN(%d)", message); + return unk; + } +} diff --git a/gtk/gtkxembed.h b/gtk/gtkxembed.h index d18e81a12..5de99e9a9 100644 --- a/gtk/gtkxembed.h +++ b/gtk/gtkxembed.h @@ -38,10 +38,11 @@ void _gtk_xembed_send_focus_message (GdkWindow *recipient, XEmbedMessageType message, glong detail); -void _gtk_xembed_push_message (XEvent *xevent); -void _gtk_xembed_pop_message (void); -void _gtk_xembed_set_focus_wrapped (void); -gboolean _gtk_xembed_get_focus_wrapped (void); +void _gtk_xembed_push_message (XEvent *xevent); +void _gtk_xembed_pop_message (void); +void _gtk_xembed_set_focus_wrapped (void); +gboolean _gtk_xembed_get_focus_wrapped (void); +const char *_gtk_xembed_message_name (XEmbedMessageType message); G_END_DECLS -- cgit v1.2.1