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.
This commit is contained in:
Luca Bacci
2023-05-30 19:51:57 +02:00
parent a23bc894e9
commit 8861d0eb53
2 changed files with 56 additions and 55 deletions

View 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)
{

View 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);