You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

124 lines
4.2 KiB

  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. * 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. #ifndef __GDK_WIN32_H__
  26. #define __GDK_WIN32_H__
  27. #include <gdk/gdkprivate.h>
  28. #ifndef STRICT
  29. #define STRICT /* We want strict type checks */
  30. #endif
  31. #include <windows.h>
  32. #include <commctrl.h>
  33. G_BEGIN_DECLS
  34. #ifdef INSIDE_GDK_WIN32
  35. #include "gdkprivate-win32.h"
  36. #undef GDK_ROOT_PARENT /* internal access is direct */
  37. #define GDK_ROOT_PARENT() ((GdkWindow *) _gdk_parent_root)
  38. #define GDK_WINDOW_HWND(win) (GDK_DRAWABLE_IMPL_WIN32(((GdkWindowObject *)win)->impl)->handle)
  39. #define GDK_PIXMAP_HBITMAP(pixmap) (GDK_DRAWABLE_IMPL_WIN32(((GdkPixmapObject *)pixmap)->impl)->handle)
  40. #define GDK_DRAWABLE_IMPL_WIN32_HANDLE(d) (((GdkDrawableImplWin32 *) d)->handle)
  41. #define GDK_DRAWABLE_HANDLE(win) (GDK_IS_WINDOW (win) ? GDK_WINDOW_HWND (win) : (GDK_IS_PIXMAP (win) ? GDK_PIXMAP_HBITMAP (win) : (GDK_IS_DRAWABLE_IMPL_WIN32 (win) ? GDK_DRAWABLE_IMPL_WIN32_HANDLE (win) : 0)))
  42. #else
  43. /* definition for exported 'internals' go here */
  44. #define GDK_WINDOW_HWND(d) (gdk_win32_drawable_get_handle (d))
  45. #endif
  46. #define GDK_ROOT_WINDOW() ((guint32) HWND_DESKTOP)
  47. #define GDK_DISPLAY() NULL
  48. /* These need to be here so gtkstatusicon.c can pick them up if needed. */
  49. #ifndef WM_XBUTTONDOWN
  50. #define WM_XBUTTONDOWN 0x020B
  51. #endif
  52. #ifndef WM_XBUTTONUP
  53. #define WM_XBUTTONUP 0x020C
  54. #endif
  55. #ifndef GET_XBUTTON_WPARAM
  56. #define GET_XBUTTON_WPARAM(w) (HIWORD(w))
  57. #endif
  58. #ifndef XBUTTON1
  59. #define XBUTTON1 1
  60. #endif
  61. #ifndef XBUTTON2
  62. #define XBUTTON2 2
  63. #endif
  64. /* Return true if the GdkWindow is a win32 implemented window */
  65. gboolean gdk_win32_window_is_win32 (GdkWindow *window);
  66. /* Return the Gdk* for a particular HANDLE */
  67. gpointer gdk_win32_handle_table_lookup (GdkNativeWindow handle);
  68. /* Translate from drawable to Windows handle */
  69. HGDIOBJ gdk_win32_drawable_get_handle (GdkDrawable *drawable);
  70. /* Return a device context to draw in a drawable, given a GDK GC,
  71. * and a mask indicating which GC values might be used (for efficiency,
  72. * no need to muck around with text-related stuff if we aren't going
  73. * to output text, for instance).
  74. */
  75. HDC gdk_win32_hdc_get (GdkDrawable *drawable,
  76. GdkGC *gc,
  77. GdkGCValuesMask usage);
  78. /* Each HDC returned from gdk_win32_hdc_get must be released with
  79. * this function
  80. */
  81. void gdk_win32_hdc_release (GdkDrawable *drawable,
  82. GdkGC *gc,
  83. GdkGCValuesMask usage);
  84. void gdk_win32_selection_add_targets (GdkWindow *owner,
  85. GdkAtom selection,
  86. gint n_targets,
  87. GdkAtom *targets);
  88. /* For internal GTK use only */
  89. GdkPixbuf *gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon);
  90. HICON gdk_win32_pixbuf_to_hicon_libgtk_only (GdkPixbuf *pixbuf);
  91. void gdk_win32_set_modal_dialog_libgtk_only (HWND window);
  92. GdkDrawable *gdk_win32_begin_direct_draw_libgtk_only (GdkDrawable *drawable,
  93. GdkGC *gc,
  94. gpointer *priv_data,
  95. gint *x_offset_out,
  96. gint *y_offset_out);
  97. void gdk_win32_end_direct_draw_libgtk_only (gpointer priv_data);
  98. G_END_DECLS
  99. #endif /* __GDK_WIN32_H__ */