static void init_stock_hash (void) { if (stock_hash == NULL) { stock_hash = g_hash_table_new (g_str_hash, g_str_equal); gtk_stock_add_static (builtin_items, G_N_ELEMENTS (builtin_items)); } if (translate_hash == NULL) { translate_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); gtk_stock_set_translate_func (GETTEXT_PACKAGE, sgettext_swapped, "Stock label", NULL); gtk_stock_set_translate_func (GETTEXT_PACKAGE "-navigation", sgettext_swapped, "Stock label, navigation", NULL); gtk_stock_set_translate_func (GETTEXT_PACKAGE "-media", sgettext_swapped, "Stock label, media", NULL); } }
static VALUE stock_m_set_translate_func(VALUE klass, VALUE domain) { VALUE func = rb_block_proc(); G_RELATIVE(klass, func); gtk_stock_set_translate_func(RVAL2CSTR(domain), (GtkTranslateFunc)translate_func, (gpointer)func, NULL); return Qnil; }