GdkWin32: Turn a few functions to static
authorLuca Bacci <luca.bacci982@gmail.com>
Tue, 30 May 2023 17:51:57 +0000 (19:51 +0200)
committerLuca Bacci <luca.bacci982@gmail.com>
Wed, 31 May 2023 10:15:57 +0000 (12:15 +0200)
When used only in the source file they're defined in.
Also remove the corresponding declarations from
gdkrivate-win32.h.

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

index 79ddcacd7f28769123ec560ee71aadbc1e4c726c..7356193500af187b04d7e02a7206dee9e314a354 100644 (file)
@@ -183,48 +183,6 @@ static_printf (const char *format,
   return retval;
 }
 
-void
-_gdk_win32_print_dc (HDC hdc)
-{
-  HGDIOBJ obj;
-  LOGBRUSH logbrush;
-  EXTLOGPEN extlogpen;
-  HRGN hrgn;
-  RECT rect;
-  int flag;
-
-  g_print ("%p:\n", hdc);
-  obj = GetCurrentObject (hdc, OBJ_BRUSH);
-  GetObject (obj, sizeof (LOGBRUSH), &logbrush);
-  g_print ("brush: %s color=%06lx hatch=%p\n",
-          _gdk_win32_lbstyle_to_string (logbrush.lbStyle),
-          logbrush.lbColor, (gpointer) logbrush.lbHatch);
-  obj = GetCurrentObject (hdc, OBJ_PEN);
-  GetObject (obj, sizeof (EXTLOGPEN), &extlogpen);
-  g_print ("pen: %s %s %s %s w=%d %s\n",
-          _gdk_win32_pstype_to_string (extlogpen.elpPenStyle),
-          _gdk_win32_psstyle_to_string (extlogpen.elpPenStyle),
-          _gdk_win32_psendcap_to_string (extlogpen.elpPenStyle),
-          _gdk_win32_psjoin_to_string (extlogpen.elpPenStyle),
-          (int) extlogpen.elpWidth,
-          _gdk_win32_lbstyle_to_string (extlogpen.elpBrushStyle));
-  g_print ("rop2: %s textcolor=%06lx\n",
-          _gdk_win32_rop2_to_string (GetROP2 (hdc)),
-          GetTextColor (hdc));
-  hrgn = CreateRectRgn (0, 0, 0, 0);
-  if ((flag = GetClipRgn (hdc, hrgn)) == -1)
-    WIN32_API_FAILED ("GetClipRgn");
-  else if (flag == 0)
-    g_print ("no clip region\n");
-  else if (flag == 1)
-    {
-      GetRgnBox (hrgn, &rect);
-      g_print ("clip region: %p bbox: %s\n",
-              hrgn, _gdk_win32_rect_to_string (&rect));
-    }
-  DeleteObject (hrgn);
-}
-
 char *
 _gdk_win32_surface_state_to_string (GdkToplevelState state)
 {
@@ -387,7 +345,7 @@ _gdk_win32_drag_action_to_string (GdkDragAction actions)
   return static_printf ("%s", buf);
 }
 
-char *
+static char *
 _gdk_win32_rop2_to_string (int rop2)
 {
   switch (rop2)
@@ -416,7 +374,7 @@ _gdk_win32_rop2_to_string (int rop2)
   return NULL;
 }
 
-char *
+static char *
 _gdk_win32_lbstyle_to_string (UINT brush_style)
 {
   switch (brush_style)
@@ -435,7 +393,7 @@ _gdk_win32_lbstyle_to_string (UINT brush_style)
   return NULL;
 }
 
-char *
+static char *
 _gdk_win32_pstype_to_string (DWORD pen_style)
 {
   switch (pen_style & PS_TYPE_MASK)
@@ -448,7 +406,7 @@ _gdk_win32_pstype_to_string (DWORD pen_style)
   return NULL;
 }
 
-char *
+static char *
 _gdk_win32_psstyle_to_string (DWORD pen_style)
 {
   switch (pen_style & PS_STYLE_MASK)
@@ -470,7 +428,7 @@ _gdk_win32_psstyle_to_string (DWORD pen_style)
   return NULL;
 }
 
-char *
+static char *
 _gdk_win32_psendcap_to_string (DWORD pen_style)
 {
   switch (pen_style & PS_ENDCAP_MASK)
@@ -486,7 +444,7 @@ _gdk_win32_psendcap_to_string (DWORD pen_style)
   return NULL;
 }
 
-char *
+static char *
 _gdk_win32_psjoin_to_string (DWORD pen_style)
 {
   switch (pen_style & PS_JOIN_MASK)
@@ -502,6 +460,56 @@ _gdk_win32_psjoin_to_string (DWORD pen_style)
   return NULL;
 }
 
+void
+_gdk_win32_print_dc (HDC hdc)
+{
+  HGDIOBJ obj;
+  LOGBRUSH logbrush;
+  EXTLOGPEN extlogpen;
+  HRGN hrgn;
+  RECT rect;
+  int flag;
+
+  g_print ("%p:\n", hdc);
+
+  obj = GetCurrentObject (hdc, OBJ_BRUSH);
+  GetObject (obj, sizeof (LOGBRUSH), &logbrush);
+
+  g_print ("brush: %s color=%06lx hatch=%p\n",
+           _gdk_win32_lbstyle_to_string (logbrush.lbStyle),
+           logbrush.lbColor, (gpointer) logbrush.lbHatch);
+
+  obj = GetCurrentObject (hdc, OBJ_PEN);
+  GetObject (obj, sizeof (EXTLOGPEN), &extlogpen);
+
+  g_print ("pen: %s %s %s %s w=%d %s\n",
+           _gdk_win32_pstype_to_string (extlogpen.elpPenStyle),
+           _gdk_win32_psstyle_to_string (extlogpen.elpPenStyle),
+           _gdk_win32_psendcap_to_string (extlogpen.elpPenStyle),
+           _gdk_win32_psjoin_to_string (extlogpen.elpPenStyle),
+           (int) extlogpen.elpWidth,
+           _gdk_win32_lbstyle_to_string (extlogpen.elpBrushStyle));
+
+  g_print ("rop2: %s textcolor=%06lx\n",
+           _gdk_win32_rop2_to_string (GetROP2 (hdc)),
+           GetTextColor (hdc));
+
+  hrgn = CreateRectRgn (0, 0, 0, 0);
+
+  if ((flag = GetClipRgn (hdc, hrgn)) == -1)
+    WIN32_API_FAILED ("GetClipRgn");
+  else if (flag == 0)
+    g_print ("no clip region\n");
+  else if (flag == 1)
+    {
+      GetRgnBox (hrgn, &rect);
+      g_print ("clip region: %p bbox: %s\n",
+               hrgn, _gdk_win32_rect_to_string (&rect));
+    }
+
+  DeleteObject (hrgn);
+}
+
 char *
 _gdk_win32_message_to_string (UINT msg)
 {
index 967491b8261cc93d8d98ea5dd02686a1894a9eb8..77070fd37b893a0837924e8ad8e1366df3df785d 100644 (file)
@@ -225,19 +225,12 @@ 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_rop2_to_string       (int          rop2);
-char *_gdk_win32_lbstyle_to_string    (UINT         brush_style);
-char *_gdk_win32_pstype_to_string     (DWORD        pen_style);
-char *_gdk_win32_psstyle_to_string    (DWORD        pen_style);
-char *_gdk_win32_psendcap_to_string   (DWORD        pen_style);
-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_rect_to_string       (const RECT  *rect);
 
 void   _gdk_win32_print_event            (GdkEvent     *event);
-
 #endif
 
 char   *_gdk_win32_last_error_string (void);