var = g_getenv ("GTK_EXE_PREFIX");
if (var)
- path = g_build_filename (var, "lib", "gtk-2.0", GTK_BINARY_VERSION, type, NULL);
+ path = g_build_filename (var, "lib", "gtk-3.0", GTK_BINARY_VERSION, type, NULL);
else
- path = g_build_filename (GTK_LIBDIR, "gtk-2.0", GTK_BINARY_VERSION, type, NULL);
+ path = g_build_filename (GTK_LIBDIR, "gtk-3.0", GTK_BINARY_VERSION, type, NULL);
return path;
}
if (im_module_file)
result = g_strdup (im_module_file);
else
- result = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gtk.immodules", NULL);
+ result = g_build_filename (GTK_SYSCONFDIR, "gtk-3.0", "gtk.immodules", NULL);
}
return result;
else
{
const gchar *home;
- str = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gtkrc", NULL);
+ str = g_build_filename (GTK_SYSCONFDIR, "gtk-3.0", "gtkrc", NULL);
gtk_rc_add_default_file (str);
g_free (str);
home = g_get_home_dir ();
if (home)
{
- str = g_build_filename (home, ".gtkrc-2.0", NULL);
+ str = g_build_filename (home, ".gtkrc-3.0", NULL);
gtk_rc_add_default_file (str);
g_free (str);
}
gchar *subpath;
if (type)
- subpath = g_strconcat ("gtk-2.0-", type,
+ subpath = g_strconcat ("gtk-3.0-", type,
G_DIR_SEPARATOR_S "gtkrc",
NULL);
else
- subpath = g_strdup ("gtk-2.0" G_DIR_SEPARATOR_S "gtkrc");
+ subpath = g_strdup ("gtk-3.0" G_DIR_SEPARATOR_S "gtkrc");
/* First look in the users home directory
*/
}
}
-void
-gtk_rc_style_ref (GtkRcStyle *rc_style)
-{
- g_return_if_fail (GTK_IS_RC_STYLE (rc_style));
-
- g_object_ref (rc_style);
-}
-
-void
-gtk_rc_style_unref (GtkRcStyle *rc_style)
-{
- g_return_if_fail (GTK_IS_RC_STYLE (rc_style));
-
- g_object_unref (rc_style);
-}
-
static GtkRcStyle *
gtk_rc_style_real_create_rc_style (GtkRcStyle *style)
{
return priv->color_hashes;
}
+static void gtk_rc_style_prepend_empty_color_hash (GtkRcStyle *rc_style);
+
+void
+_gtk_rc_style_set_symbolic_color (GtkRcStyle *rc_style,
+ const gchar *name,
+ const GdkColor *color)
+{
+ GtkRcStylePrivate *priv = GTK_RC_STYLE_GET_PRIVATE (rc_style);
+ GHashTable *our_hash = NULL;
+
+ if (priv->color_hashes)
+ our_hash = priv->color_hashes->data;
+
+ if (our_hash == NULL)
+ {
+ if (color == NULL)
+ return;
+
+ gtk_rc_style_prepend_empty_color_hash (rc_style);
+ our_hash = priv->color_hashes->data;
+ }
+
+ if (color)
+ g_hash_table_insert (our_hash, g_strdup (name), gdk_color_copy (color));
+ else
+ g_hash_table_remove (our_hash, name);
+}
+
static gint
gtk_rc_properties_cmp (gconstpointer bsearch_node1,
gconstpointer bsearch_node2)
return NULL;
}
-static GSList *
-gtk_rc_add_rc_sets (GSList *slist,
- GtkRcStyle *rc_style,
- const gchar *pattern,
- GtkPathType path_type)
-{
- GtkRcStyle *new_style;
- GtkRcSet *rc_set;
- guint i;
-
- new_style = gtk_rc_style_new ();
- *new_style = *rc_style;
- new_style->name = g_strdup (rc_style->name);
- if (rc_style->font_desc)
- new_style->font_desc = pango_font_description_copy (rc_style->font_desc);
-
- for (i = 0; i < 5; i++)
- new_style->bg_pixmap_name[i] = g_strdup (rc_style->bg_pixmap_name[i]);
-
- rc_set = g_new (GtkRcSet, 1);
- rc_set->type = path_type;
-
- if (path_type == GTK_PATH_WIDGET_CLASS)
- {
- rc_set->pspec = NULL;
- rc_set->path = _gtk_rc_parse_widget_class_path (pattern);
- }
- else
- {
- rc_set->pspec = g_pattern_spec_new (pattern);
- rc_set->path = NULL;
- }
-
- rc_set->rc_style = rc_style;
-
- return g_slist_prepend (slist, rc_set);
-}
-
-void
-gtk_rc_add_widget_name_style (GtkRcStyle *rc_style,
- const gchar *pattern)
-{
- GtkRcContext *context;
-
- g_return_if_fail (rc_style != NULL);
- g_return_if_fail (pattern != NULL);
-
- context = gtk_rc_context_get (gtk_settings_get_default ());
-
- context->rc_sets_widget = gtk_rc_add_rc_sets (context->rc_sets_widget, rc_style, pattern, GTK_PATH_WIDGET);
-}
-
-void
-gtk_rc_add_widget_class_style (GtkRcStyle *rc_style,
- const gchar *pattern)
-{
- GtkRcContext *context;
-
- g_return_if_fail (rc_style != NULL);
- g_return_if_fail (pattern != NULL);
-
- context = gtk_rc_context_get (gtk_settings_get_default ());
-
- context->rc_sets_widget_class = gtk_rc_add_rc_sets (context->rc_sets_widget_class, rc_style, pattern, GTK_PATH_WIDGET_CLASS);
-}
-
-void
-gtk_rc_add_class_style (GtkRcStyle *rc_style,
- const gchar *pattern)
-{
- GtkRcContext *context;
-
- g_return_if_fail (rc_style != NULL);
- g_return_if_fail (pattern != NULL);
-
- context = gtk_rc_context_get (gtk_settings_get_default ());
-
- context->rc_sets_class = gtk_rc_add_rc_sets (context->rc_sets_class, rc_style, pattern, GTK_PATH_CLASS);
-}
-
GScanner*
gtk_rc_scanner_new (void)
{