summaryrefslogtreecommitdiff
path: root/gtk/gtkxembed.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2005-07-21 13:20:06 +0000
committerTor Lillqvist <tml@src.gnome.org>2005-07-21 13:20:06 +0000
commit2e96cb67cedf3ab723f670b10731d06d1f0384b4 (patch)
tree7ee6bff6e6682cc5c99ad45eefcb136ad189371a /gtk/gtkxembed.c
parent46c99b962f35c3268040cd21e61b804e3b353512 (diff)
downloadgtk+-2e96cb67cedf3ab723f670b10731d06d1f0384b4.tar.gz
gtk/gtkxembed.h New function, used in error messages and debugging output.
2005-07-21 Tor Lillqvist <tml@novell.com> * gtk/gtkxembed.h * gtk/gtkxembed.c (_gtk_xembed_message_name): New function, used in error messages and debugging output.
Diffstat (limited to 'gtk/gtkxembed.c')
-rw-r--r--gtk/gtkxembed.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/gtk/gtkxembed.c b/gtk/gtkxembed.c
index 4d084f1401..164b4c2bb7 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;
+ }
+}