From: Luca Bacci Date: Tue, 30 May 2023 17:51:57 +0000 (+0200) Subject: GdkWin32: Turn a few functions to static X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~192^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8861d0eb53708faaf698ed262abb261e4290deca;p=gtk4.git GdkWin32: Turn a few functions to static When used only in the source file they're defined in. Also remove the corresponding declarations from gdkrivate-win32.h. --- diff --git a/gdk/win32/gdkmain-win32.c b/gdk/win32/gdkmain-win32.c index 79ddcacd7f..7356193500 100644 --- a/gdk/win32/gdkmain-win32.c +++ b/gdk/win32/gdkmain-win32.c @@ -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) { diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h index 967491b826..77070fd37b 100644 --- a/gdk/win32/gdkprivate-win32.h +++ b/gdk/win32/gdkprivate-win32.h @@ -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);