]> Pileus Git - ~andy/gtk/blob - gtk/gtkwin32embed.h
stylecontext: Do invalidation on first resize container
[~andy/gtk] / gtk / gtkwin32embed.h
1 /* GTK - The GIMP Toolkit
2  * gtkwin32embed.h: Utilities for Win32 embedding
3  * Copyright (C) 2005, Novell, Inc.
4  *
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.
9  *
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.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
17  */
18
19 /* By Tor Lillqvist <tml@novell.com> 2005 */
20
21 #ifndef __GTK_WIN32_EMBED_H__
22 #define __GTK_WIN32_EMBED_H__
23
24 G_BEGIN_DECLS
25
26 #define GTK_WIN32_EMBED_PROTOCOL_VERSION 1
27
28 /*
29  * When the plug and socket are in separate processes they use a
30  * simple protocol, more or less based on XEMBED. The protocol uses
31  * registered window messages. The name passed to
32  * RegisterWindowMessage() is gtk-win32-embed:%d, with %d being the
33  * numeric value of an GtkWin32EmbedMessageType enum. Each message
34  * carries the message type enum value and two integers, the "wparam"
35  * and "lparam", like all window messages.
36  *
37  * So far all the window messages are posted to the other
38  * process. Maybe some later enhancement will add also messages that
39  * are sent, i.e. where the sending process waits for the receiving
40  * process's window procedure to handle the message.
41  */
42
43 typedef enum {                                  /* send or post? */
44   /* First those sent from the socket
45    * to the plug
46    */
47   GTK_WIN32_EMBED_WINDOW_ACTIVATE,              /* post */
48   GTK_WIN32_EMBED_WINDOW_DEACTIVATE,            /* post */
49   GTK_WIN32_EMBED_FOCUS_IN,                     /* post */
50   GTK_WIN32_EMBED_FOCUS_OUT,                    /* post */
51   GTK_WIN32_EMBED_MODALITY_ON,                  /* post */
52   GTK_WIN32_EMBED_MODALITY_OFF,                 /* post */
53
54   /* Then the ones sent from the plug
55    * to the socket.
56    */
57   GTK_WIN32_EMBED_PARENT_NOTIFY,                /* post */
58   GTK_WIN32_EMBED_EVENT_PLUG_MAPPED,            /* post */
59   GTK_WIN32_EMBED_PLUG_RESIZED,                 /* post */
60   GTK_WIN32_EMBED_REQUEST_FOCUS,                /* post */
61   GTK_WIN32_EMBED_FOCUS_NEXT,                   /* post */
62   GTK_WIN32_EMBED_FOCUS_PREV,                   /* post */
63   GTK_WIN32_EMBED_GRAB_KEY,                     /* post */
64   GTK_WIN32_EMBED_UNGRAB_KEY,                   /* post */
65   GTK_WIN32_EMBED_LAST
66 } GtkWin32EmbedMessageType;
67
68 /* wParam values for GTK_WIN32_EMBED_FOCUS_IN: */
69 #define GTK_WIN32_EMBED_FOCUS_CURRENT 0
70 #define GTK_WIN32_EMBED_FOCUS_FIRST 1
71 #define GTK_WIN32_EMBED_FOCUS_LAST 2
72
73 /* Flags for lParam in GTK_WIN32_EMBED_FOCUS_IN, GTK_WIN32_EMBED_FOCUS_NEXT,
74  * GTK_WIN32_EMBED_FOCUS_PREV
75  */
76 #define GTK_WIN32_EMBED_FOCUS_WRAPAROUND         (1 << 0)
77
78 guint _gtk_win32_embed_message_type (GtkWin32EmbedMessageType type);
79 void _gtk_win32_embed_push_message (MSG *msg);
80 void _gtk_win32_embed_pop_message (void);
81 void _gtk_win32_embed_send (GdkWindow               *recipient,
82                             GtkWin32EmbedMessageType message,
83                             WPARAM                   wparam,
84                             LPARAM                   lparam);
85 void _gtk_win32_embed_send_focus_message (GdkWindow               *recipient,
86                                           GtkWin32EmbedMessageType message,
87                                           WPARAM                   wparam);
88 void     _gtk_win32_embed_set_focus_wrapped  (void);
89 gboolean _gtk_win32_embed_get_focus_wrapped  (void);
90
91 G_END_DECLS
92
93 #endif /*  __GTK_WIN32_EMBED_H__ */