diff options
author | José Dapena Paz <jdapena@igalia.com> | 2012-07-16 08:38:31 +0200 |
---|---|---|
committer | Rob Bradford <rob@linux.intel.com> | 2012-07-17 11:31:54 +0100 |
commit | c5ef4e660ba828bdebeb0c9aef183fc24cb4394d (patch) | |
tree | 976bfb5d821aac222f8de62ceedf3edea9799491 /gdk | |
parent | 0ea892069bedf44d07d03247555564b18cd80541 (diff) | |
download | gtk+-c5ef4e660ba828bdebeb0c9aef183fc24cb4394d.tar.gz |
wayland: Add default settings implementation for Wayland backend.
Signed-off-by: Rob Bradford <rob@linux.intel.com>
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/wayland/gdkscreen-wayland.c | 70 |
1 files changed, 68 insertions, 2 deletions
diff --git a/gdk/wayland/gdkscreen-wayland.c b/gdk/wayland/gdkscreen-wayland.c index 1132e9718d..1a14bf50aa 100644 --- a/gdk/wayland/gdkscreen-wayland.c +++ b/gdk/wayland/gdkscreen-wayland.c @@ -77,6 +77,9 @@ struct _GdkWaylandMonitor G_DEFINE_TYPE (GdkWaylandScreen, _gdk_wayland_screen, GDK_TYPE_SCREEN) +#define MM_PER_INCH 25 +#define DEFAULT_DPI 96 + static void init_monitor_geometry (GdkWaylandMonitor *monitor, int x, int y, int width, int height) @@ -86,8 +89,8 @@ init_monitor_geometry (GdkWaylandMonitor *monitor, monitor->geometry.width = width; monitor->geometry.height = height; - monitor->width_mm = -1; - monitor->height_mm = -1; + monitor->width_mm = width/DEFAULT_DPI*MM_PER_INCH; + monitor->height_mm = height/DEFAULT_DPI*MM_PER_INCH; monitor->output_name = NULL; monitor->manufacturer = NULL; } @@ -297,6 +300,69 @@ gdk_wayland_screen_get_setting (GdkScreen *screen, const gchar *name, GValue *value) { + g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE); + + if (strcmp ("gtk-theme-name", name) == 0) + { + const gchar *s = "Adwaita"; + GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : %s\n", name, s)); + g_value_set_string (value, s); + return TRUE; + } + else if (strcmp ("gtk-icon-theme-name", name) == 0) + { + const gchar *s = "gnome"; + GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : %s\n", name, s)); + g_value_set_string (value, s); + return TRUE; + } + else if (strcmp ("gtk-double-click-time", name) == 0) + { + gint i = 250; + GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : %d\n", name, i)); + g_value_set_int (value, i); + return TRUE; + } + else if (strcmp ("gtk-double-click-distance", name) == 0) + { + gint i = 5; + GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : %d\n", name, i)); + g_value_set_int (value, i); + return TRUE; + } + else if (strcmp ("gtk-dnd-drag-threshold", name) == 0) + { + gint i = 8; + GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : %d\n", name, i)); + g_value_set_int (value, i); + return TRUE; + } + else if (strcmp ("gtk-split-cursor", name) == 0) + { + GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : FALSE\n", name)); + g_value_set_boolean (value, FALSE); + return TRUE; + } + else if (strcmp ("gtk-alternative-button-order", name) == 0) + { + GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : TRUE\n", name)); + g_value_set_boolean (value, TRUE); + return TRUE; + } + else if (strcmp ("gtk-alternative-sort-arrows", name) == 0) + { + GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : TRUE\n", name)); + g_value_set_boolean (value, TRUE); + return TRUE; + } + else if (strcmp ("gtk-xft-dpi", name) == 0) + { + gint i = 96*1024; + GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : TRUE\n", name)); + g_value_set_int (value, i); + return TRUE; + } + return FALSE; } |