Commit adb912e4 authored by Christian Persch's avatar Christian Persch

Revert unintentional API/ABI break

parent aa44d758
......@@ -297,3 +297,10 @@ gucharmap_chapters_view_get_book_codepoint_list (GucharmapChaptersView *view)
return gucharmap_chapters_model_get_book_codepoint_list (priv->model);
}
gboolean
gucharmap_chapters_view_select_locale (GucharmapChaptersView *view)
{
return gucharmap_chapters_view_select_character (view,
gucharmap_unicode_get_locale_character ());
}
......@@ -75,6 +75,8 @@ gchar * gucharmap_chapters_view_get_selected (GucharmapChaptersView
gboolean gucharmap_chapters_view_set_selected (GucharmapChaptersView *view,
const gchar *name);
gboolean gucharmap_chapters_view_select_locale (GucharmapChaptersView *view);
G_END_DECLS
#endif /* #ifndef GUCHARMAP_CHAPTERS_VIEW_H */
......@@ -649,3 +649,41 @@ gucharmap_unichar_isgraph (gunichar uc)
&& t != G_UNICODE_SURROGATE
&& t != G_UNICODE_SPACE_SEPARATOR);
}
static gunichar
get_first_non_underscore_char (const char *str)
{
const char *p;
if (!str)
return 0;
for (p = str; p && *p; p = g_utf8_find_next_char (p, NULL))
{
gunichar ch;
ch = g_utf8_get_char (p);
if (g_unichar_isalpha (ch))
return ch;
}
return 0;
}
/**
* gucharmap_unicode_get_locale_character:
*
* Determines a character that's commonly used in the current
* locale's script.
*
* Returns: a unicode character
*/
gunichar
gucharmap_unicode_get_locale_character (void)
{
GtkStockItem item;
if (!gtk_stock_lookup (GTK_STOCK_FIND, &item))
return 0;
return get_first_non_underscore_char (item.label);
}
......@@ -79,6 +79,9 @@ G_CONST_RETURN gchar * gucharmap_unicode_get_script_for_char (gunichar wc);
G_CONST_RETURN gchar * gucharmap_unicode_version_to_string (GucharmapUnicodeVersion version);
/* doesn't really belong here, but no better place was available */
gunichar gucharmap_unicode_get_locale_character (void);
G_END_DECLS
#endif /* #ifndef GUCHARMAP_UNICODE_INFO_H */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment