1
/* GTK - The GIMP Toolkit
2
* gtkwin32embed.h: Utilities for Win32 embedding
3
* Copyright (C) 2005, Novell, Inc.
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the
17
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
* Boston, MA 02111-1307, USA.
21
/* By Tor Lillqvist <tml@novell.com> 2005 */
23
#ifndef __GTK_WIN32_EMBED_H__
24
#define __GTK_WIN32_EMBED_H__
28
#define GTK_WIN32_EMBED_PROTOCOL_VERSION 1
31
* When the plug and socket are in separate processes they use a
32
* simple protocol, more or less based on XEMBED. The protocol uses
33
* registered window messages. The name passed to
34
* RegisterWindowMessage() is gtk-win32-embed:%d, with %d being the
35
* numeric value of an GtkWin32EmbedMessageType enum. Each message
36
* carries the message type enum value and two integers, the "wparam"
37
* and "lparam", like all window messages.
39
* So far all the window messages are posted to the other
40
* process. Maybe some later enhancement will add also messages that
41
* are sent, i.e. where the sending process waits for the receiving
42
* process's window procedure to handle the message.
45
typedef enum { /* send or post? */
46
/* First those sent from the socket
49
GTK_WIN32_EMBED_WINDOW_ACTIVATE, /* post */
50
GTK_WIN32_EMBED_WINDOW_DEACTIVATE, /* post */
51
GTK_WIN32_EMBED_FOCUS_IN, /* post */
52
GTK_WIN32_EMBED_FOCUS_OUT, /* post */
53
GTK_WIN32_EMBED_MODALITY_ON, /* post */
54
GTK_WIN32_EMBED_MODALITY_OFF, /* post */
56
/* Then the ones sent from the plug
59
GTK_WIN32_EMBED_PARENT_NOTIFY, /* post */
60
GTK_WIN32_EMBED_EVENT_PLUG_MAPPED, /* post */
61
GTK_WIN32_EMBED_PLUG_RESIZED, /* post */
62
GTK_WIN32_EMBED_REQUEST_FOCUS, /* post */
63
GTK_WIN32_EMBED_FOCUS_NEXT, /* post */
64
GTK_WIN32_EMBED_FOCUS_PREV, /* post */
65
GTK_WIN32_EMBED_GRAB_KEY, /* post */
66
GTK_WIN32_EMBED_UNGRAB_KEY, /* post */
68
} GtkWin32EmbedMessageType;
70
/* wParam values for GTK_WIN32_EMBED_FOCUS_IN: */
71
#define GTK_WIN32_EMBED_FOCUS_CURRENT 0
72
#define GTK_WIN32_EMBED_FOCUS_FIRST 1
73
#define GTK_WIN32_EMBED_FOCUS_LAST 2
75
/* Flags for lParam in GTK_WIN32_EMBED_FOCUS_IN, GTK_WIN32_EMBED_FOCUS_NEXT,
76
* GTK_WIN32_EMBED_FOCUS_PREV
78
#define GTK_WIN32_EMBED_FOCUS_WRAPAROUND (1 << 0)
80
guint _gtk_win32_embed_message_type (GtkWin32EmbedMessageType type);
81
void _gtk_win32_embed_push_message (MSG *msg);
82
void _gtk_win32_embed_pop_message (void);
83
void _gtk_win32_embed_send (GdkWindow *recipient,
84
GtkWin32EmbedMessageType message,
87
void _gtk_win32_embed_send_focus_message (GdkWindow *recipient,
88
GtkWin32EmbedMessageType message,
90
void _gtk_win32_embed_set_focus_wrapped (void);
91
gboolean _gtk_win32_embed_get_focus_wrapped (void);
95
#endif /* __GTK_WIN32_EMBED_H__ */