diff --git a/gtk/gtkwin32draw.c b/gtk/gtkwin32draw.c index 7590e09bdf..16459ce390 100644 --- a/gtk/gtkwin32draw.c +++ b/gtk/gtkwin32draw.c @@ -450,6 +450,34 @@ static struct { { "cxpaddedborder", 0, NULL } }; +const char * +gtk_win32_get_sys_metric_name_for_id (gint id) +{ + if (id >= 0 && id < G_N_ELEMENTS (win32_default_metrics)) + return win32_default_metrics[id].name; + else + return NULL; +} + +int +gtk_win32_get_sys_metric_id_for_name (const char *name) +{ + int i; + + g_return_val_if_fail (name != NULL, -1); + + for (i = 0; i < G_N_ELEMENTS (win32_default_metrics); i++) + { + if (win32_default_metrics[i].name == NULL) + continue; + + if (g_str_equal (name, win32_default_metrics[i].name)) + return i; + } + + return -1; +} + int gtk_win32_get_sys_metric (gint id) { diff --git a/gtk/gtkwin32drawprivate.h b/gtk/gtkwin32drawprivate.h index da8ce7c74e..ad419ae672 100644 --- a/gtk/gtkwin32drawprivate.h +++ b/gtk/gtkwin32drawprivate.h @@ -167,6 +167,8 @@ void gtk_win32_get_theme_margins (const char int state, GtkBorder *out_margins); +const char * gtk_win32_get_sys_metric_name_for_id (gint id); +int gtk_win32_get_sys_metric_id_for_name (const char *name); int gtk_win32_get_sys_metric (gint id); const char * gtk_win32_get_sys_color_name_for_id (gint id);