]> Pileus Git - ~andy/gtk/blob - gdk/win32/gdkwin32.h
Add win32 implementation for foreign window functions
[~andy/gtk] / gdk / win32 / gdkwin32.h
1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /*
21  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
25  */
26
27 #ifndef __GDK_WIN32_H__
28 #define __GDK_WIN32_H__
29
30 #include <gdk/gdkprivate.h>
31
32 #ifndef STRICT
33 #define STRICT                  /* We want strict type checks */
34 #endif
35 #include <windows.h>
36 #include <commctrl.h>
37
38 G_BEGIN_DECLS
39
40 #ifdef INSIDE_GDK_WIN32
41
42 #include "gdkprivate-win32.h"
43
44 #define GDK_WINDOW_HWND(win)          (GDK_DRAWABLE_IMPL_WIN32(((GdkWindowObject *)win)->impl)->handle)
45 #define GDK_DRAWABLE_IMPL_WIN32_HANDLE(d) (((GdkDrawableImplWin32 *) d)->handle)
46 #define GDK_DRAWABLE_HANDLE(win)      (GDK_IS_WINDOW (win) ? GDK_WINDOW_HWND (win) : (GDK_IS_DRAWABLE_IMPL_WIN32 (win) ? GDK_DRAWABLE_IMPL_WIN32_HANDLE (win) : 0))
47 #else
48 /* definition for exported 'internals' go here */
49 #define GDK_WINDOW_HWND(d) (gdk_win32_drawable_get_handle (d))
50
51 #endif
52
53 #define GDK_ROOT_WINDOW()             ((guint32) HWND_DESKTOP)
54 #define GDK_DISPLAY()                 NULL
55
56
57 /* These need to be here so gtkstatusicon.c can pick them up if needed. */
58 #ifndef WM_XBUTTONDOWN
59 #define WM_XBUTTONDOWN 0x020B
60 #endif
61 #ifndef WM_XBUTTONUP
62 #define WM_XBUTTONUP 0x020C
63 #endif
64 #ifndef GET_XBUTTON_WPARAM
65 #define GET_XBUTTON_WPARAM(w) (HIWORD(w))
66 #endif
67 #ifndef XBUTTON1
68 #define XBUTTON1 1
69 #endif
70 #ifndef XBUTTON2
71 #define XBUTTON2 2
72 #endif
73
74
75 /* Return true if the GdkWindow is a win32 implemented window */
76 gboolean      gdk_win32_window_is_win32 (GdkWindow *window);
77
78 /* Return the Gdk* for a particular HANDLE */
79 gpointer      gdk_win32_handle_table_lookup (GdkNativeWindow handle);
80
81 /* Translate from drawable to Windows handle */
82 HGDIOBJ       gdk_win32_drawable_get_handle (GdkDrawable *drawable);
83
84 void          gdk_win32_selection_add_targets (GdkWindow  *owner,
85                                                GdkAtom     selection,
86                                                gint        n_targets,
87                                                GdkAtom    *targets);
88
89 /* For internal GTK use only */
90 GdkPixbuf    *gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon);
91 HICON         gdk_win32_pixbuf_to_hicon_libgtk_only (GdkPixbuf *pixbuf);
92 void          gdk_win32_set_modal_dialog_libgtk_only (HWND window);
93
94 GdkWindow *   gdk_win32_window_foreign_new_for_display (GdkDisplay *display,
95                                                         GdkNativeWindow anid);
96 GdkWindow *   gdk_win32_window_lookup_for_display (GdkDisplay *display,
97                                                    GdkNativeWindow anid);
98
99 G_END_DECLS
100
101 #endif /* __GDK_WIN32_H__ */