mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-16 15:14:17 +00:00
win32: Allow querying names for metrics
This commit is contained in:
parent
63934ba36c
commit
98216867d1
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user