2006-02-27 13:56:30 +00:00
|
|
|
/* GDK - The GIMP Drawing Kit
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2006-02-27 13:56:30 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
* files for a list of changes. These files are distributed with
|
2006-02-27 14:08:06 +00:00
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
2006-02-27 13:56:30 +00:00
|
|
|
*/
|
|
|
|
|
2013-01-26 20:53:58 +00:00
|
|
|
static const struct {
|
|
|
|
const char *xname, *gdkname;
|
|
|
|
} gdk_settings_map[] = {
|
|
|
|
{"Net/DoubleClickTime", "gtk-double-click-time"},
|
|
|
|
{"Net/DoubleClickDistance", "gtk-double-click-distance"},
|
|
|
|
{"Net/DndDragThreshold", "gtk-dnd-drag-threshold"},
|
2013-08-17 02:45:13 +00:00
|
|
|
{"Net/CursorBlink", "gtk-cursor-blink"},
|
|
|
|
{"Net/CursorBlinkTime", "gtk-cursor-blink-time"},
|
2013-01-26 20:53:58 +00:00
|
|
|
{"Net/ThemeName", "gtk-theme-name"},
|
|
|
|
{"Net/IconThemeName", "gtk-icon-theme-name"},
|
|
|
|
{"Gtk/ColorPalette", "gtk-color-palette"},
|
|
|
|
{"Gtk/FontName", "gtk-font-name"},
|
|
|
|
{"Gtk/KeyThemeName", "gtk-key-theme-name"},
|
|
|
|
{"Gtk/Modules", "gtk-modules"},
|
2013-10-25 00:35:55 +00:00
|
|
|
{"Gtk/ButtonImages", "gtk-button-images"},
|
2013-10-25 00:03:02 +00:00
|
|
|
{"Gtk/MenuImages", "gtk-menu-images"},
|
2013-01-26 20:53:58 +00:00
|
|
|
{"Gtk/CursorThemeName", "gtk-cursor-theme-name"},
|
|
|
|
{"Gtk/CursorThemeSize", "gtk-cursor-theme-size"},
|
|
|
|
{"Gtk/ColorScheme", "gtk-color-scheme"},
|
|
|
|
{"Gtk/EnableAnimations", "gtk-enable-animations"},
|
|
|
|
{"Xft/Antialias", "gtk-xft-antialias"},
|
|
|
|
{"Xft/Hinting", "gtk-xft-hinting"},
|
|
|
|
{"Xft/HintStyle", "gtk-xft-hintstyle"},
|
|
|
|
{"Xft/RGBA", "gtk-xft-rgba"},
|
|
|
|
{"Xft/DPI", "gtk-xft-dpi"},
|
|
|
|
{"Gtk/EnableAccels", "gtk-enable-accels"},
|
|
|
|
{"Gtk/ScrolledWindowPlacement", "gtk-scrolled-window-placement"},
|
|
|
|
{"Gtk/IMModule", "gtk-im-module"},
|
|
|
|
{"Fontconfig/Timestamp", "gtk-fontconfig-timestamp"},
|
|
|
|
{"Net/SoundThemeName", "gtk-sound-theme-name"},
|
|
|
|
{"Net/EnableInputFeedbackSounds", "gtk-enable-input-feedback-sounds"},
|
|
|
|
{"Net/EnableEventSounds", "gtk-enable-event-sounds"},
|
2013-08-17 02:45:13 +00:00
|
|
|
{"Gtk/CursorBlinkTimeout", "gtk-cursor-blink-timeout"},
|
2013-01-26 20:53:58 +00:00
|
|
|
{"Gtk/ShellShowsAppMenu", "gtk-shell-shows-app-menu"},
|
|
|
|
{"Gtk/ShellShowsMenubar", "gtk-shell-shows-menubar"},
|
2013-11-14 20:01:19 +00:00
|
|
|
{"Gtk/ShellShowsDesktop", "gtk-shell-shows-desktop"},
|
2013-12-22 02:58:24 +00:00
|
|
|
{"Gtk/DecorationLayout", "gtk-decoration-layout"},
|
2014-09-25 05:25:25 +00:00
|
|
|
{"Gtk/TitlebarDoubleClick", "gtk-titlebar-double-click"},
|
|
|
|
{"Gtk/TitlebarMiddleClick", "gtk-titlebar-middle-click"},
|
|
|
|
{"Gtk/TitlebarRightClick", "gtk-titlebar-right-click"},
|
2014-01-15 05:33:30 +00:00
|
|
|
{"Gtk/DialogsUseHeader", "gtk-dialogs-use-header"},
|
2013-01-26 20:53:58 +00:00
|
|
|
{"Gtk/EnablePrimaryPaste", "gtk-enable-primary-paste"},
|
2013-02-13 16:05:07 +00:00
|
|
|
{"Gtk/RecentFilesMaxAge", "gtk-recent-files-max-age"},
|
2013-06-27 20:45:40 +00:00
|
|
|
{"Gtk/RecentFilesEnabled", "gtk-recent-files-enabled"},
|
|
|
|
|
|
|
|
/* These are here in order to be recognized, but are not sent to
|
|
|
|
gtk as they are handled internally by gdk: */
|
2013-06-28 11:23:45 +00:00
|
|
|
{"Gdk/WindowScalingFactor", "gdk-window-scaling-factor"},
|
|
|
|
{"Gdk/UnscaledDPI", "gdk-unscaled-dpi"}
|
2013-01-26 20:53:58 +00:00
|
|
|
};
|
2006-02-27 13:56:30 +00:00
|
|
|
|
2013-02-14 16:20:26 +00:00
|
|
|
static const char *
|
2013-01-26 20:53:58 +00:00
|
|
|
gdk_from_xsettings_name (const char *xname)
|
|
|
|
{
|
|
|
|
static GHashTable *hash = NULL;
|
|
|
|
guint i;
|
2006-02-27 13:56:30 +00:00
|
|
|
|
2013-01-26 20:53:58 +00:00
|
|
|
if (G_UNLIKELY (hash == NULL))
|
|
|
|
{
|
|
|
|
hash = g_hash_table_new (g_str_hash, g_str_equal);
|
2011-11-30 19:46:55 +00:00
|
|
|
|
2013-01-26 20:53:58 +00:00
|
|
|
for (i = 0; i < G_N_ELEMENTS (gdk_settings_map); i++)
|
|
|
|
g_hash_table_insert (hash, (gpointer)gdk_settings_map[i].xname,
|
|
|
|
(gpointer)gdk_settings_map[i].gdkname);
|
|
|
|
}
|
2007-12-18 03:24:17 +00:00
|
|
|
|
2013-01-26 20:53:58 +00:00
|
|
|
return g_hash_table_lookup (hash, xname);
|
|
|
|
}
|
2006-02-27 13:56:30 +00:00
|
|
|
|