GdkWin32: Remove unused debug functions
authorLuca Bacci <luca.bacci982@gmail.com>
Tue, 30 May 2023 17:51:38 +0000 (19:51 +0200)
committerLuca Bacci <luca.bacci982@gmail.com>
Wed, 31 May 2023 10:15:57 +0000 (12:15 +0200)
 * _gdk_win32_print_paletteentries
 * _gdk_win32_print_system_palette
 * _gdk_win32_print_hpalette
 * _gdk_win32_drag_protocol_to_string
 * _gdk_win32_data_to_string
 * _gdk_win32_gdkrectangle_to_string
 * _gdk_win32_cairo_region_to_string
 * _gdk_win32_surface_description

gdk/win32/gdkmain-win32.c
gdk/win32/gdkprivate-win32.h

index bcc1d21ad429fac9dacaff90950fd1f2b573c489..79ddcacd7f28769123ec560ee71aadbc1e4c726c 100644 (file)
@@ -45,9 +45,6 @@
 #include <wintab.h>
 #include <imm.h>
 
-/* for CFSTR_SHELLIDLIST */
-#include <shlobj.h>
-
 static gboolean gdk_synchronize = FALSE;
 
 /* Whether GDK initialized COM */
@@ -186,77 +183,6 @@ static_printf (const char *format,
   return retval;
 }
 
-void
-_gdk_win32_print_paletteentries (const PALETTEENTRY *pep,
-                               const int           nentries)
-{
-  char buf[20];
-  int i;
-
-  for (i = 0; i < nentries; i++)
-    g_print ("  %3d %02x:  %02x %02x %02x%s\n",
-            i, i,
-            pep[i].peRed, pep[i].peGreen, pep[i].peBlue,
-            (pep[i].peFlags == 0 ? "" :
-             (pep[i].peFlags == PC_EXPLICIT ? " PC_EXPLICIT" :
-              (pep[i].peFlags == PC_NOCOLLAPSE ? " PC_NOCOLLAPSE" :
-               (pep[i].peFlags == PC_RESERVED ? " PC_RESERVED" :
-                (g_sprintf (buf, " %d", pep[i].peFlags), buf))))));
-}
-
-void
-_gdk_win32_print_system_palette (void)
-{
-  PALETTEENTRY *pe;
-  int k;
-
-  k = GetSystemPaletteEntries (_gdk_display_hdc, 0, 0, NULL);
-  pe = g_new (PALETTEENTRY, k);
-  k = GetSystemPaletteEntries (_gdk_display_hdc, 0, k, pe);
-
-  if (!k)
-    g_print ("GetSystemPaletteEntries failed: %s\n",
-            g_win32_error_message (GetLastError ()));
-  else
-    {
-      g_print ("System palette: %d entries\n", k);
-      _gdk_win32_print_paletteentries (pe, k);
-    }
-  g_free (pe);
-}
-
-static int
-palette_size (HPALETTE hpal)
-{
-  WORD npal = 0;
-
-  if (!GetObject (hpal, sizeof (npal), &npal))
-    WIN32_GDI_FAILED ("GetObject (HPALETTE)");
-
-  return npal;
-}
-
-void
-_gdk_win32_print_hpalette (HPALETTE hpal)
-{
-  PALETTEENTRY *pe;
-  int n, npal;
-
-  npal = palette_size (hpal);
-  pe = g_new (PALETTEENTRY, npal);
-  n = GetPaletteEntries (hpal, 0, npal, pe);
-
-  if (!n)
-    g_print ("HPALETTE %p: GetPaletteEntries failed: %s\n",
-            hpal, g_win32_error_message (GetLastError ()));
-  else
-    {
-      g_print ("HPALETTE %p: %d (%d) entries\n", hpal, n, npal);
-      _gdk_win32_print_paletteentries (pe, n);
-    }
-  g_free (pe);
-}
-
 void
 _gdk_win32_print_dc (HDC hdc)
 {
@@ -299,22 +225,6 @@ _gdk_win32_print_dc (HDC hdc)
   DeleteObject (hrgn);
 }
 
-char *
-_gdk_win32_drag_protocol_to_string (GdkDragProtocol protocol)
-{
-  switch (protocol)
-    {
-#define CASE(x) case GDK_DRAG_PROTO_##x: return #x
-      CASE (NONE);
-      CASE (WIN32_DROPFILES);
-      CASE (OLE2);
-#undef CASE
-    default: return static_printf ("illegal_%d", protocol);
-    }
-  /* NOTREACHED */
-  return NULL;
-}
-
 char *
 _gdk_win32_surface_state_to_string (GdkToplevelState state)
 {
@@ -892,26 +802,6 @@ _gdk_win32_cf_to_string (UINT format)
     }
 }
 
-char *
-_gdk_win32_data_to_string (const guchar *data,
-                          int           nbytes)
-{
-  GString *s = g_string_new ("");
-  int i;
-  char *retval;
-
-  for (i = 0; i < nbytes; i++)
-    if (data[i] >=' ' && data[i] <= '~')
-      g_string_append_printf (s, "%c  ", data[i]);
-    else
-      g_string_append_printf (s, "%02X ", data[i]);
-
-  retval = static_printf ("%s", s->str);
-  g_string_free (s, TRUE);
-
-  return retval;
-}
-
 char *
 _gdk_win32_rect_to_string (const RECT *rect)
 {
@@ -920,34 +810,4 @@ _gdk_win32_rect_to_string (const RECT *rect)
                        rect->left, rect->top);
 }
 
-char *
-_gdk_win32_gdkrectangle_to_string (const GdkRectangle *rect)
-{
-  return static_printf ("%dx%d@%+d%+d",
-                       rect->width, rect->height,
-                       rect->x, rect->y);
-}
-
-char *
-_gdk_win32_cairo_region_to_string (const cairo_region_t *rgn)
-{
-  cairo_rectangle_int_t extents;
-  cairo_region_get_extents (rgn, &extents);
-  return static_printf ("%dx%d@%+d%+d",
-                       extents.width, extents.height,
-                       extents.x, extents.y);
-}
-
-char *
-_gdk_win32_surface_description (GdkSurface *d)
-{
-  g_return_val_if_fail (GDK_IS_SURFACE (d), NULL);
-
-  return static_printf ("%s:%p:%dx%d",
-                       G_OBJECT_TYPE_NAME (d),
-                       GDK_SURFACE_HWND (d),
-                       gdk_surface_get_width (GDK_SURFACE (d)),
-                        gdk_surface_get_height (GDK_SURFACE (d)));
-}
-
 #endif /* G_ENABLE_DEBUG */
index f4d9b4812affc166ee112ba5989f8999248e5228..967491b8261cc93d8d98ea5dd02686a1894a9eb8 100644 (file)
@@ -217,19 +217,13 @@ gboolean gdk_win32_ensure_com (void);
 gboolean gdk_win32_ensure_ole (void);
 
 #ifdef G_ENABLE_DEBUG
-void   _gdk_win32_print_paletteentries (const PALETTEENTRY *pep,
-                                        const int           nentries);
-void   _gdk_win32_print_system_palette (void);
-void   _gdk_win32_print_hpalette       (HPALETTE     hpal);
 void   _gdk_win32_print_dc             (HDC          hdc);
 
-char *_gdk_win32_drag_protocol_to_string (GdkDragProtocol protocol);
 char *_gdk_win32_surface_state_to_string (GdkToplevelState state);
 char *_gdk_win32_surface_style_to_string (LONG style);
 char *_gdk_win32_surface_exstyle_to_string (LONG style);
 char *_gdk_win32_surface_pos_bits_to_string (UINT flags);
 char *_gdk_win32_drag_action_to_string (GdkDragAction actions);
-char *_gdk_win32_surface_description (GdkSurface *d);
 
 char *_gdk_win32_rop2_to_string       (int          rop2);
 char *_gdk_win32_lbstyle_to_string    (UINT         brush_style);
@@ -240,13 +234,8 @@ char *_gdk_win32_psjoin_to_string     (DWORD        pen_style);
 char *_gdk_win32_message_to_string    (UINT         msg);
 char *_gdk_win32_key_to_string        (LONG         lParam);
 char *_gdk_win32_cf_to_string         (UINT         format);
-char *_gdk_win32_data_to_string       (const guchar*data,
-                                        int          nbytes);
 char *_gdk_win32_rect_to_string       (const RECT  *rect);
 
-char *_gdk_win32_gdkrectangle_to_string (const GdkRectangle *rect);
-char *_gdk_win32_cairo_region_to_string (const cairo_region_t    *box);
-
 void   _gdk_win32_print_event            (GdkEvent     *event);
 
 #endif