1 /* GDK - The GIMP Drawing Kit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3 * Copyright (C) 1998-2002 Tor Lillqvist
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.
22 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
23 * file for a list of people on the GTK+ Team. See the ChangeLog
24 * files for a list of changes. These files are distributed with
25 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
30 #include <glib/gprintf.h>
37 #include "gdkregion-generic.h"
38 #include "gdkkeysyms.h"
39 #include "gdkinternals.h"
41 #include "gdkprivate-win32.h"
42 #include "gdkinput-win32.h"
46 #if defined (__GNUC__) && defined (HAVE_DIMM_H)
47 /* The w32api imm.h clashes a bit with the IE5.5 dimm.h */
48 # define IMEMENUITEMINFOA hidden_IMEMENUITEMINFOA
49 # define IMEMENUITEMINFOW hidden_IMEMENUITEMINFOW
54 static gboolean gdk_synchronize = FALSE;
56 static gboolean dummy;
58 GOptionEntry _gdk_windowing_args[] = {
59 { "sync", 0, 0, G_OPTION_ARG_NONE, &gdk_synchronize,
60 /* Description of --sync in --help output */ N_("Don't batch GDI requests"), NULL },
61 { "no-wintab", 0, 0, G_OPTION_ARG_NONE, &_gdk_input_ignore_wintab,
62 /* Description of --no-wintab in --help output */ N_("Don't use the Wintab API for tablet support"), NULL },
63 { "ignore-wintab", 0, 0, G_OPTION_ARG_NONE, &_gdk_input_ignore_wintab,
64 /* Description of --ignore-wintab in --help output */ N_("Same as --no-wintab"), NULL },
65 { "use-wintab", 0, 0, G_OPTION_ARG_NONE, &dummy,
66 /* Description of --use-wintab in --help output */ N_("Do use the Wintab API [default]"), NULL },
67 { "max-colors", 0, 0, G_OPTION_ARG_INT, &_gdk_max_colors,
68 /* Description of --max-colors=COLORS in --help output */ N_("Size of the palette in 8 bit mode"),
69 /* Placeholder in --max-colors=COLORS in --help output */ N_("COLORS") },
74 DllMain (HINSTANCE hinstDLL,
78 _gdk_dll_hinstance = hinstDLL;
84 _gdk_windowing_init (void)
89 if (getenv ("GDK_IGNORE_WINTAB") != NULL)
90 _gdk_input_ignore_wintab = TRUE;
91 else if (getenv ("GDK_USE_WINTAB") != NULL)
92 _gdk_input_ignore_wintab = FALSE;
98 _gdk_app_hmodule = GetModuleHandle (NULL);
99 _gdk_display_hdc = CreateDC ("DISPLAY", NULL, NULL, NULL);
100 _gdk_input_locale = GetKeyboardLayout (0);
101 _gdk_input_locale_is_ime = ImmIsIME (_gdk_input_locale);
102 GetLocaleInfo (MAKELCID (LOWORD (_gdk_input_locale), SORT_DEFAULT),
103 LOCALE_IDEFAULTANSICODEPAGE,
105 _gdk_input_codepage = atoi (buf);
106 GDK_NOTE (EVENTS, g_print ("input_locale:%p, codepage:%d\n",
107 _gdk_input_locale, _gdk_input_codepage));
111 _cf_rtf = RegisterClipboardFormat ("Rich Text Format");
112 _cf_utf8_string = RegisterClipboardFormat ("UTF8_STRING");
114 _utf8_string = gdk_atom_intern ("UTF8_STRING", FALSE);
115 _targets = gdk_atom_intern ("TARGETS", FALSE);
117 _text_uri_list = gdk_atom_intern ("text/uri-list", FALSE);
118 _image_bmp = gdk_atom_intern ("image/bmp", FALSE);
120 _local_dnd = gdk_atom_intern ("LocalDndSelection", FALSE);
121 _gdk_win32_dropfiles = gdk_atom_intern ("DROPFILES_DND", FALSE);
122 _gdk_ole2_dnd = gdk_atom_intern ("OLE2_DND", FALSE);
124 _gdk_selection_property = gdk_atom_intern ("GDK_SELECTION", FALSE);
126 _wm_transient_for = gdk_atom_intern ("WM_TRANSIENT_FOR", FALSE);
128 _gdk_win32_selection_init ();
132 _gdk_win32_api_failed (const gchar *where,
136 gchar *msg = g_win32_error_message (GetLastError ());
137 g_warning ("%s:%d: %s failed: %s", where, line, api, msg);
142 _gdk_other_api_failed (const gchar *where,
146 g_warning ("%s:%d: %s failed", where, line, api);
150 _gdk_win32_gdi_failed (const gchar *where,
154 /* On Win9x GDI calls are implemented in 16-bit code and thus
155 * don't set the 32-bit error code, sigh.
157 if (G_WIN32_IS_NT_BASED ())
158 _gdk_win32_api_failed (where, line, api);
160 _gdk_other_api_failed (where, line, api);
164 gdk_set_use_xshm (gboolean use_xshm)
170 gdk_get_use_xshm (void)
176 gdk_screen_get_width (GdkScreen *screen)
178 return GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (_gdk_root)->impl)->width;
182 gdk_screen_get_height (GdkScreen *screen)
184 return GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (_gdk_root)->impl)->height;
187 gdk_screen_get_width_mm (GdkScreen *screen)
189 return (double) gdk_screen_get_width (screen) / GetDeviceCaps (_gdk_display_hdc, LOGPIXELSX) * 25.4;
193 gdk_screen_get_height_mm (GdkScreen *screen)
195 return (double) gdk_screen_get_height (screen) / GetDeviceCaps (_gdk_display_hdc, LOGPIXELSY) * 25.4;
199 _gdk_windowing_display_set_sm_client_id (GdkDisplay *display,
200 const gchar *sm_client_id)
202 g_warning("gdk_set_sm_client_id %s", sm_client_id ? sm_client_id : "NULL");
206 gdk_display_beep (GdkDisplay *display)
208 g_return_if_fail (display == gdk_display_get_default());
213 _gdk_windowing_exit (void)
215 _gdk_win32_dnd_exit ();
217 DeleteDC (_gdk_display_hdc);
218 _gdk_display_hdc = NULL;
222 gdk_get_display (void)
224 return g_strdup (gdk_display_get_name (gdk_display_get_default ()));
228 gdk_error_trap_push (void)
233 gdk_error_trap_pop (void)
239 gdk_notify_startup_complete (void)
243 #ifdef G_ENABLE_DEBUG
246 * Like g_strdup_printf, but to a static buffer. Return value does not
247 * have to be g_free()d. The buffer is of bounded size and reused
248 * cyclically. Thus the return value is valid only until that part of
249 * the buffer happens to get reused. This doesn't matter as this
250 * function's return value is used in debugging output right after the call,
251 * and the return value isn't used after that.
254 static_printf (const gchar *format,
257 static gchar buf[10000];
259 static gchar *bufp = buf;
263 va_start (args, format);
264 msg = g_strdup_vprintf (format, args);
267 g_assert (strlen (msg) < sizeof (buf));
269 if (bufp + strlen (msg) + 1 > buf + sizeof (buf))
274 bufp += strlen (msg) + 1;
281 _gdk_win32_color_to_string (const GdkColor *color)
283 return static_printf ("(%.04x,%.04x,%.04x):%.06x",
284 color->red, color->green,
285 color->blue, color->pixel);
289 _gdk_win32_print_paletteentries (const PALETTEENTRY *pep,
295 for (i = 0; i < nentries; i++)
296 g_print (" %3d %02x: %02x %02x %02x%s\n",
298 pep[i].peRed, pep[i].peGreen, pep[i].peBlue,
299 (pep[i].peFlags == 0 ? "" :
300 (pep[i].peFlags == PC_EXPLICIT ? " PC_EXPLICIT" :
301 (pep[i].peFlags == PC_NOCOLLAPSE ? " PC_NOCOLLAPSE" :
302 (pep[i].peFlags == PC_RESERVED ? " PC_RESERVED" :
303 (g_sprintf (buf, " %d", pep[i].peFlags), buf))))));
307 _gdk_win32_print_system_palette (void)
312 k = GetSystemPaletteEntries (_gdk_display_hdc, 0, 0, NULL);
313 pe = g_new (PALETTEENTRY, k);
314 k = GetSystemPaletteEntries (_gdk_display_hdc, 0, k, pe);
317 g_print ("GetSystemPaletteEntries failed: %s\n",
318 g_win32_error_message (GetLastError ()));
321 g_print ("System palette: %d entries\n", k);
322 _gdk_win32_print_paletteentries (pe, k);
328 palette_size (HPALETTE hpal)
332 if (!GetObject (hpal, sizeof (npal), &npal))
333 WIN32_GDI_FAILED ("GetObject (HPALETTE)");
339 _gdk_win32_print_hpalette (HPALETTE hpal)
344 npal = palette_size (hpal);
345 pe = g_new (PALETTEENTRY, npal);
346 n = GetPaletteEntries (hpal, 0, npal, pe);
349 g_print ("HPALETTE %p: GetPaletteEntries failed: %s\n",
350 hpal, g_win32_error_message (GetLastError ()));
353 g_print ("HPALETTE %p: %d (%d) entries\n", hpal, n, npal);
354 _gdk_win32_print_paletteentries (pe, n);
360 _gdk_win32_print_dc (HDC hdc)
369 g_print ("%p:\n", hdc);
370 obj = GetCurrentObject (hdc, OBJ_BRUSH);
371 GetObject (obj, sizeof (LOGBRUSH), &logbrush);
372 g_print ("brush: %s color=%06lx hatch=%p\n",
373 _gdk_win32_lbstyle_to_string (logbrush.lbStyle),
374 logbrush.lbColor, (gpointer) logbrush.lbHatch);
375 obj = GetCurrentObject (hdc, OBJ_PEN);
376 GetObject (obj, sizeof (EXTLOGPEN), &extlogpen);
377 g_print ("pen: %s %s %s %s w=%d %s\n",
378 _gdk_win32_pstype_to_string (extlogpen.elpPenStyle),
379 _gdk_win32_psstyle_to_string (extlogpen.elpPenStyle),
380 _gdk_win32_psendcap_to_string (extlogpen.elpPenStyle),
381 _gdk_win32_psjoin_to_string (extlogpen.elpPenStyle),
383 _gdk_win32_lbstyle_to_string (extlogpen.elpBrushStyle));
384 g_print ("rop2: %s textcolor=%06lx\n",
385 _gdk_win32_rop2_to_string (GetROP2 (hdc)),
387 hrgn = CreateRectRgn (0, 0, 0, 0);
388 if ((flag = GetClipRgn (hdc, hrgn)) == -1)
389 WIN32_API_FAILED ("GetClipRgn");
391 g_print ("no clip region\n");
394 GetRgnBox (hrgn, &rect);
395 g_print ("clip region: %p bbox: %s\n",
396 hrgn, _gdk_win32_rect_to_string (&rect));
402 _gdk_win32_cap_style_to_string (GdkCapStyle cap_style)
406 #define CASE(x) case GDK_CAP_##x: return #x
412 default: return static_printf ("illegal_%d", cap_style);
419 _gdk_win32_fill_style_to_string (GdkFill fill)
423 #define CASE(x) case GDK_##x: return #x
427 CASE (OPAQUE_STIPPLED);
429 default: return static_printf ("illegal_%d", fill);
436 _gdk_win32_function_to_string (GdkFunction function)
440 #define CASE(x) case GDK_##x: return #x
457 default: return static_printf ("illegal_%d", function);
464 _gdk_win32_join_style_to_string (GdkJoinStyle join_style)
468 #define CASE(x) case GDK_JOIN_##x: return #x
473 default: return static_printf ("illegal_%d", join_style);
480 _gdk_win32_line_style_to_string (GdkLineStyle line_style)
484 #define CASE(x) case GDK_LINE_##x: return #x
489 default: return static_printf ("illegal_%d", line_style);
496 _gdk_win32_gcvalues_mask_to_string (GdkGCValuesMask mask)
505 if (mask & GDK_GC_##x) \
506 (bufp += g_sprintf (bufp, "%s" #x, s), s = "|")
528 return static_printf ("%s", buf);
532 _gdk_win32_window_state_to_string (GdkWindowState state)
541 if (state & GDK_WINDOW_STATE_ ## x) \
542 (bufp += sprintf (bufp, "%s" #x, s), s = "|")
544 /* For clarity, also show the complement of WITHDRAWN, i.e. "MAPPED" */
545 if (!(state & GDK_WINDOW_STATE_WITHDRAWN))
546 (bufp += sprintf (bufp, "MAPPED"), s = "|");
554 return static_printf ("%s", buf);
558 _gdk_win32_rop2_to_string (int rop2)
562 #define CASE(x) case R2_##x: return #x
580 default: return static_printf ("illegal_%x", rop2);
587 _gdk_win32_lbstyle_to_string (UINT brush_style)
591 #define CASE(x) case BS_##x: return #x
599 default: return static_printf ("illegal_%d", brush_style);
606 _gdk_win32_pstype_to_string (DWORD pen_style)
608 switch (pen_style & PS_TYPE_MASK)
610 case PS_GEOMETRIC: return "GEOMETRIC";
611 case PS_COSMETIC: return "COSMETIC";
612 default: return static_printf ("illegal_%d", pen_style & PS_TYPE_MASK);
619 _gdk_win32_psstyle_to_string (DWORD pen_style)
621 switch (pen_style & PS_STYLE_MASK)
623 #define CASE(x) case PS_##x: return #x
634 default: return static_printf ("illegal_%d", pen_style & PS_STYLE_MASK);
641 _gdk_win32_psendcap_to_string (DWORD pen_style)
643 switch (pen_style & PS_ENDCAP_MASK)
645 #define CASE(x) case PS_ENDCAP_##x: return #x
650 default: return static_printf ("illegal_%d", pen_style & PS_ENDCAP_MASK);
657 _gdk_win32_psjoin_to_string (DWORD pen_style)
659 switch (pen_style & PS_JOIN_MASK)
661 #define CASE(x) case PS_JOIN_##x: return #x
666 default: return static_printf ("illegal_%d", pen_style & PS_JOIN_MASK);
673 _gdk_win32_message_to_string (UINT msg)
677 #define CASE(x) case x: return #x
690 CASE (WM_GETTEXTLENGTH);
693 CASE (WM_QUERYENDSESSION);
695 CASE (WM_ENDSESSION);
697 CASE (WM_ERASEBKGND);
698 CASE (WM_SYSCOLORCHANGE);
699 CASE (WM_SHOWWINDOW);
700 CASE (WM_WININICHANGE);
701 CASE (WM_DEVMODECHANGE);
702 CASE (WM_ACTIVATEAPP);
703 CASE (WM_FONTCHANGE);
704 CASE (WM_TIMECHANGE);
705 CASE (WM_CANCELMODE);
707 CASE (WM_MOUSEACTIVATE);
708 CASE (WM_CHILDACTIVATE);
710 CASE (WM_GETMINMAXINFO);
712 CASE (WM_ICONERASEBKGND);
713 CASE (WM_NEXTDLGCTL);
714 CASE (WM_SPOOLERSTATUS);
716 CASE (WM_MEASUREITEM);
717 CASE (WM_DELETEITEM);
718 CASE (WM_VKEYTOITEM);
719 CASE (WM_CHARTOITEM);
724 CASE (WM_QUERYDRAGICON);
725 CASE (WM_COMPAREITEM);
727 CASE (WM_COMPACTING);
728 CASE (WM_WINDOWPOSCHANGING);
729 CASE (WM_WINDOWPOSCHANGED);
732 CASE (WM_CANCELJOURNAL);
734 CASE (WM_INPUTLANGCHANGEREQUEST);
735 CASE (WM_INPUTLANGCHANGE);
738 CASE (WM_USERCHANGED);
739 CASE (WM_NOTIFYFORMAT);
740 CASE (WM_CONTEXTMENU);
741 CASE (WM_STYLECHANGING);
742 CASE (WM_STYLECHANGED);
743 CASE (WM_DISPLAYCHANGE);
748 CASE (WM_NCCALCSIZE);
751 CASE (WM_NCACTIVATE);
752 CASE (WM_GETDLGCODE);
754 CASE (WM_NCMOUSEMOVE);
755 CASE (WM_NCLBUTTONDOWN);
756 CASE (WM_NCLBUTTONUP);
757 CASE (WM_NCLBUTTONDBLCLK);
758 CASE (WM_NCRBUTTONDOWN);
759 CASE (WM_NCRBUTTONUP);
760 CASE (WM_NCRBUTTONDBLCLK);
761 CASE (WM_NCMBUTTONDOWN);
762 CASE (WM_NCMBUTTONUP);
763 CASE (WM_NCMBUTTONDBLCLK);
764 CASE (WM_NCXBUTTONDOWN);
765 CASE (WM_NCXBUTTONUP);
766 CASE (WM_NCXBUTTONDBLCLK);
771 CASE (WM_SYSKEYDOWN);
774 CASE (WM_SYSDEADCHAR);
776 CASE (WM_IME_STARTCOMPOSITION);
777 CASE (WM_IME_ENDCOMPOSITION);
778 CASE (WM_IME_COMPOSITION);
779 CASE (WM_INITDIALOG);
781 CASE (WM_SYSCOMMAND);
786 CASE (WM_INITMENUPOPUP);
787 CASE (WM_MENUSELECT);
790 CASE (WM_MENURBUTTONUP);
792 CASE (WM_MENUGETOBJECT);
793 CASE (WM_UNINITMENUPOPUP);
794 CASE (WM_MENUCOMMAND);
795 CASE (WM_CHANGEUISTATE);
796 CASE (WM_UPDATEUISTATE);
797 CASE (WM_QUERYUISTATE);
798 CASE (WM_CTLCOLORMSGBOX);
799 CASE (WM_CTLCOLOREDIT);
800 CASE (WM_CTLCOLORLISTBOX);
801 CASE (WM_CTLCOLORBTN);
802 CASE (WM_CTLCOLORDLG);
803 CASE (WM_CTLCOLORSCROLLBAR);
804 CASE (WM_CTLCOLORSTATIC);
806 CASE (WM_LBUTTONDOWN);
808 CASE (WM_LBUTTONDBLCLK);
809 CASE (WM_RBUTTONDOWN);
811 CASE (WM_RBUTTONDBLCLK);
812 CASE (WM_MBUTTONDOWN);
814 CASE (WM_MBUTTONDBLCLK);
815 CASE (WM_MOUSEWHEEL);
816 CASE (WM_XBUTTONDOWN);
818 CASE (WM_XBUTTONDBLCLK);
819 CASE (WM_PARENTNOTIFY);
820 CASE (WM_ENTERMENULOOP);
821 CASE (WM_EXITMENULOOP);
824 CASE (WM_CAPTURECHANGED);
826 CASE (WM_POWERBROADCAST);
827 CASE (WM_DEVICECHANGE);
829 CASE (WM_MDIDESTROY);
830 CASE (WM_MDIACTIVATE);
831 CASE (WM_MDIRESTORE);
833 CASE (WM_MDIMAXIMIZE);
835 CASE (WM_MDICASCADE);
836 CASE (WM_MDIICONARRANGE);
837 CASE (WM_MDIGETACTIVE);
838 CASE (WM_MDISETMENU);
839 CASE (WM_ENTERSIZEMOVE);
840 CASE (WM_EXITSIZEMOVE);
842 CASE (WM_MDIREFRESHMENU);
843 CASE (WM_IME_SETCONTEXT);
844 CASE (WM_IME_NOTIFY);
845 CASE (WM_IME_CONTROL);
846 CASE (WM_IME_COMPOSITIONFULL);
847 CASE (WM_IME_SELECT);
849 CASE (WM_IME_REQUEST);
850 CASE (WM_IME_KEYDOWN);
852 CASE (WM_MOUSEHOVER);
853 CASE (WM_MOUSELEAVE);
854 CASE (WM_NCMOUSEHOVER);
855 CASE (WM_NCMOUSELEAVE);
861 CASE (WM_RENDERFORMAT);
862 CASE (WM_RENDERALLFORMATS);
863 CASE (WM_DESTROYCLIPBOARD);
864 CASE (WM_DRAWCLIPBOARD);
865 CASE (WM_PAINTCLIPBOARD);
866 CASE (WM_VSCROLLCLIPBOARD);
867 CASE (WM_SIZECLIPBOARD);
868 CASE (WM_ASKCBFORMATNAME);
869 CASE (WM_CHANGECBCHAIN);
870 CASE (WM_HSCROLLCLIPBOARD);
871 CASE (WM_QUERYNEWPALETTE);
872 CASE (WM_PALETTEISCHANGING);
873 CASE (WM_PALETTECHANGED);
876 CASE (WM_PRINTCLIENT);
877 CASE (WM_APPCOMMAND);
878 CASE (WM_HANDHELDFIRST);
879 CASE (WM_HANDHELDLAST);
882 CASE (WM_PENWINFIRST);
883 CASE (WM_PENWINLAST);
892 if (msg >= WM_HANDHELDFIRST && msg <= WM_HANDHELDLAST)
893 return static_printf ("WM_HANDHELDFIRST+%d", msg - WM_HANDHELDFIRST);
894 else if (msg >= WM_AFXFIRST && msg <= WM_AFXLAST)
895 return static_printf ("WM_AFXFIRST+%d", msg - WM_AFXFIRST);
896 else if (msg >= WM_PENWINFIRST && msg <= WM_PENWINLAST)
897 return static_printf ("WM_PENWINFIRST+%d", msg - WM_PENWINFIRST);
898 else if (msg >= WM_USER && msg <= 0x7FFF)
899 return static_printf ("WM_USER+%d", msg - WM_USER);
900 else if (msg >= 0xC000 && msg <= 0xFFFF)
901 return static_printf ("reg-%#x", msg);
903 return static_printf ("unk-%#x", msg);
910 _gdk_win32_key_to_string (LONG lParam)
915 if (GetKeyNameText (lParam, buf, sizeof (buf)) &&
916 (keyname_utf8 = g_locale_to_utf8 (buf, -1, NULL, NULL, NULL)) != NULL)
918 gchar *retval = static_printf ("%s", keyname_utf8);
920 g_free (keyname_utf8);
925 return static_printf ("unk-%#lx", lParam);
929 _gdk_win32_cf_to_string (UINT format)
935 #define CASE(x) case CF_##x: return #x
943 CASE (DSPENHMETAFILE);
944 CASE (DSPMETAFILEPICT);
961 if (format >= CF_GDIOBJFIRST &&
962 format <= CF_GDIOBJLAST)
963 return static_printf ("CF_GDIOBJ%d", format - CF_GDIOBJFIRST);
964 if (format >= CF_PRIVATEFIRST &&
965 format <= CF_PRIVATELAST)
966 return static_printf ("CF_PRIVATE%d", format - CF_PRIVATEFIRST);
967 if (GetClipboardFormatName (format, buf, sizeof (buf)))
968 return static_printf ("%s", buf);
970 return static_printf ("unk-%#lx", format);
975 _gdk_win32_data_to_string (const guchar *data,
978 GString *s = g_string_new ("");
982 for (i = 0; i < nbytes; i++)
983 if (data[i] >=' ' && data[i] <= '~')
984 g_string_append_printf (s, "%c ", data[i]);
986 g_string_append_printf (s, "%02X ", data[i]);
988 retval = static_printf ("%s", s->str);
989 g_string_free (s, TRUE);
995 _gdk_win32_rect_to_string (const RECT *rect)
997 return static_printf ("%ldx%ld@%+ld%+ld",
998 (rect->right - rect->left), (rect->bottom - rect->top),
999 rect->left, rect->top);
1003 _gdk_win32_gdkrectangle_to_string (const GdkRectangle *rect)
1005 return static_printf ("%dx%d@%+d%+d",
1006 rect->width, rect->height,
1011 _gdk_win32_gdkregion_to_string (const GdkRegion *rgn)
1013 return static_printf ("%dx%d@%+d%+d",
1014 (rgn->extents.x2 - rgn->extents.x1),
1015 (rgn->extents.y2 - rgn->extents.y1),
1016 rgn->extents.x1, rgn->extents.y1);
1020 _gdk_win32_drawable_description (GdkDrawable *d)
1022 gint width, height, depth;
1024 gdk_drawable_get_size (d, &width, &height);
1025 depth = gdk_drawable_get_depth (d);
1027 return static_printf
1029 G_OBJECT_TYPE_NAME (d),
1030 GDK_DRAWABLE_HANDLE (d),
1031 width, height, depth);
1034 #endif /* G_ENABLE_DEBUG */