| 1 |
/* GDK - The GIMP Drawing Kit |
| 2 |
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald |
| 3 |
* Copyright (C) 2013 Chun-wei Fan |
| 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 |
/* |
| 20 |
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS |
| 21 |
* file for a list of people on the GTK+ Team. See the ChangeLog |
| 22 |
* files for a list of changes. These files are distributed with |
| 23 |
* GTK+ at ftp://ftp.gtk.org/pub/gtk/. |
| 24 |
*/ |
| 25 |
|
| 26 |
#ifndef __GDK_WIN32_MISC_H__ |
| 27 |
#define __GDK_WIN32_MISC_H__ |
| 28 |
|
| 29 |
#if !defined (__GDKWIN32_H_INSIDE__) && !defined (GDK_COMPILATION) |
| 30 |
#error "Only <gdk/gdkwin32.h> can be included directly." |
| 31 |
#endif |
| 32 |
|
| 33 |
#include <gdk/gdk.h> |
| 34 |
|
| 35 |
#ifndef STRICT |
| 36 |
#define STRICT /* We want strict type checks */ |
| 37 |
#endif |
| 38 |
#include <windows.h> |
| 39 |
#include <commctrl.h> |
| 40 |
|
| 41 |
G_BEGIN_DECLS |
| 42 |
|
| 43 |
#ifdef INSIDE_GDK_WIN32 |
| 44 |
|
| 45 |
#include "gdkprivate-win32.h" |
| 46 |
|
| 47 |
#define GDK_WINDOW_HWND(win) (GDK_WINDOW_IMPL_WIN32(win->impl)->handle) |
| 48 |
#else |
| 49 |
/* definition for exported 'internals' go here */ |
| 50 |
#define GDK_WINDOW_HWND(d) (gdk_win32_window_get_handle (d)) |
| 51 |
|
| 52 |
#endif /* INSIDE_GDK_WIN32 */ |
| 53 |
|
| 54 |
/* These need to be here so gtkstatusicon.c can pick them up if needed. */ |
| 55 |
#ifndef WM_XBUTTONDOWN |
| 56 |
#define WM_XBUTTONDOWN 0x020B |
| 57 |
#endif |
| 58 |
#ifndef WM_XBUTTONUP |
| 59 |
#define WM_XBUTTONUP 0x020C |
| 60 |
#endif |
| 61 |
#ifndef GET_XBUTTON_WPARAM |
| 62 |
#define GET_XBUTTON_WPARAM(w) (HIWORD(w)) |
| 63 |
#endif |
| 64 |
#ifndef XBUTTON1 |
| 65 |
#define XBUTTON1 1 |
| 66 |
#endif |
| 67 |
#ifndef XBUTTON2 |
| 68 |
#define XBUTTON2 2 |
| 69 |
#endif |
| 70 |
|
| 71 |
/* Return true if the GdkWindow is a win32 implemented window */ |
| 72 |
GDK_AVAILABLE_IN_ALL |
| 73 |
gboolean gdk_win32_window_is_win32 (GdkWindow *window); |
| 74 |
GDK_AVAILABLE_IN_ALL |
| 75 |
HWND gdk_win32_window_get_impl_hwnd (GdkWindow *window); |
| 76 |
|
| 77 |
/* Return the Gdk* for a particular HANDLE */ |
| 78 |
GDK_AVAILABLE_IN_ALL |
| 79 |
gpointer gdk_win32_handle_table_lookup (HWND handle); |
| 80 |
/* Translate from window to Windows handle */ |
| 81 |
GDK_AVAILABLE_IN_ALL |
| 82 |
HGDIOBJ gdk_win32_window_get_handle (GdkWindow *window); |
| 83 |
|
| 84 |
GDK_AVAILABLE_IN_ALL |
| 85 |
void gdk_win32_selection_add_targets (GdkWindow *owner, |
| 86 |
GdkAtom selection, |
| 87 |
gint n_targets, |
| 88 |
GdkAtom *targets); |
| 89 |
|
| 90 |
#if defined (GTK_COMPILATION) || defined (GDK_COMPILATION) |
| 91 |
#define gdk_win32_selection_clear_targets gdk_win32_selection_clear_targets_libgtk_only |
| 92 |
GDK_AVAILABLE_IN_ALL |
| 93 |
void gdk_win32_selection_clear_targets (GdkDisplay *display, |
| 94 |
GdkAtom selection); |
| 95 |
#endif |
| 96 |
|
| 97 |
GDK_AVAILABLE_IN_ALL |
| 98 |
GdkWindow * gdk_win32_window_foreign_new_for_display (GdkDisplay *display, |
| 99 |
HWND anid); |
| 100 |
GDK_AVAILABLE_IN_ALL |
| 101 |
GdkWindow * gdk_win32_window_lookup_for_display (GdkDisplay *display, |
| 102 |
HWND anid); |
| 103 |
|
| 104 |
#if defined (INSIDE_GDK_WIN32) || defined (GDK_COMPILATION) || defined (GTK_COMPILATION) |
| 105 |
|
| 106 |
/* For internal GTK use only */ |
| 107 |
GDK_AVAILABLE_IN_ALL |
| 108 |
GdkPixbuf *gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon, |
| 109 |
gdouble *x_hot, |
| 110 |
gdouble *y_hot); |
| 111 |
GDK_AVAILABLE_IN_ALL |
| 112 |
HICON gdk_win32_pixbuf_to_hicon_libgtk_only (GdkPixbuf *pixbuf); |
| 113 |
GDK_AVAILABLE_IN_ALL |
| 114 |
void gdk_win32_set_modal_dialog_libgtk_only (HWND window); |
| 115 |
|
| 116 |
#endif |
| 117 |
|
| 118 |
G_END_DECLS |
| 119 |
|
| 120 |
#endif /* __GDK_WIN32_MISC_H__ */ |