utils

utils

Synopsis

gchar**             gtranslator_utils_split_string_in_words
                                                        (const gchar *string);
xmlDocPtr           gtranslator_xml_new_doc             (const gchar *name);
xmlDocPtr           gtranslator_xml_open_file           (const gchar *filename);
GtkWidget*          gtranslator_gtk_button_new_with_stock_icon
                                                        (const gchar *label,
                                                         const gchar *stock_id);
void                gtranslator_utils_menu_position_under_widget
                                                        (GtkMenu *menu,
                                                         gint *x,
                                                         gint *y,
                                                         gboolean *push_in,
                                                         gpointer user_data);
void                gtranslator_utils_menu_position_under_tree_view
                                                        (GtkMenu *menu,
                                                         gint *x,
                                                         gint *y,
                                                         gboolean *push_in,
                                                         gpointer user_data);
gboolean            gtranslator_utils_get_glade_widgets (const gchar *filename,
                                                         const gchar *root_node,
                                                         GtkWidget **error_widget,
                                                         const gchar *widget_name,
                                                         ...);
GSList*             gtranslator_utils_drop_get_locations
                                                        (GtkSelectionData *selection_data);
gchar*              gtranslator_utils_escape_search_text
                                                        (const gchar *text);
gchar*              gtranslator_utils_unescape_search_text
                                                        (const gchar *text);
gboolean            g_utf8_caselessnmatch               (const gchar *s1,
                                                         const gchar *s2,
                                                         gssize n1,
                                                         gssize n2);
void                gtranslator_utils_activate_url      (GtkAboutDialog *dialog,
                                                         const gchar *url,
                                                         gpointer data);
void                gtranslator_utils_activate_email    (GtkAboutDialog *dialog,
                                                         const gchar *email,
                                                         gpointer data);
void                gtranslator_utils_help_display      (GtkWindow *parent,
                                                         const gchar *doc_id,
                                                         const gchar *file_name);
gchar*              gtranslator_utils_get_user_config_dir
                                                        (void);
gchar*              gtranslator_utils_get_current_date  (void);
gchar*              gtranslator_utils_get_current_time  (void);
gchar*              gtranslator_utils_get_current_year  (void);
void                gtranslator_utils_scan_dir          (GFile *dir,
                                                         GSList **list,
                                                         const gchar *po_name);
gchar*              gtranslator_utils_reduce_path       (const gchar *path);

Description

Details

gtranslator_utils_split_string_in_words ()

gchar**             gtranslator_utils_split_string_in_words
                                                        (const gchar *string);

Process a text and split it in words using pango.

string :

the text to process

Returns :

an array of words of the processed text

gtranslator_xml_new_doc ()

xmlDocPtr           gtranslator_xml_new_doc             (const gchar *name);

name :

Returns :


gtranslator_xml_open_file ()

xmlDocPtr           gtranslator_xml_open_file           (const gchar *filename);

filename :

Returns :


gtranslator_gtk_button_new_with_stock_icon ()

GtkWidget*          gtranslator_gtk_button_new_with_stock_icon
                                                        (const gchar *label,
                                                         const gchar *stock_id);

Convenience function to create a GtkButton with a stock image.

label :

the label of the button

stock_id :

the id of the stock image

Returns :

a new GtkButton

gtranslator_utils_menu_position_under_widget ()

void                gtranslator_utils_menu_position_under_widget
                                                        (GtkMenu *menu,
                                                         gint *x,
                                                         gint *y,
                                                         gboolean *push_in,
                                                         gpointer user_data);

It returns the position to popup a menu in a TreeView.

menu :

a GtkMenu

x :

the x position of the widget

y :

the y position of the widget

push_in :

user_data :

the widget to get the position

gtranslator_utils_menu_position_under_tree_view ()

void                gtranslator_utils_menu_position_under_tree_view
                                                        (GtkMenu *menu,
                                                         gint *x,
                                                         gint *y,
                                                         gboolean *push_in,
                                                         gpointer user_data);

menu :

x :

y :

push_in :

user_data :


gtranslator_utils_get_glade_widgets ()

gboolean            gtranslator_utils_get_glade_widgets (const gchar *filename,
                                                         const gchar *root_node,
                                                         GtkWidget **error_widget,
                                                         const gchar *widget_name,
                                                         ...);

This function gets the requested widgets from a glade file. In case of error it returns FALSE and sets error_widget to a GtkLabel containing the error message to display.

filename :

the path to the glade file

root_node :

the root node in the glade file

error_widget :

a pointer were a GtkLabel

widget_name :

the name of the first widget

... :

a pointer were the first widget is returned, followed by more name / widget pairs and terminated by NULL.

Returns :

FALSE if an error occurs, TRUE on success.

gtranslator_utils_drop_get_locations ()

GSList*             gtranslator_utils_drop_get_locations
                                                        (GtkSelectionData *selection_data);

selection_data :

Returns :


gtranslator_utils_escape_search_text ()

gchar*              gtranslator_utils_escape_search_text
                                                        (const gchar *text);

text :

Returns :


gtranslator_utils_unescape_search_text ()

gchar*              gtranslator_utils_unescape_search_text
                                                        (const gchar *text);

text :

Returns :


g_utf8_caselessnmatch ()

gboolean            g_utf8_caselessnmatch               (const gchar *s1,
                                                         const gchar *s2,
                                                         gssize n1,
                                                         gssize n2);

s1 :

s2 :

n1 :

n2 :

Returns :


gtranslator_utils_activate_url ()

void                gtranslator_utils_activate_url      (GtkAboutDialog *dialog,
                                                         const gchar *url,
                                                         gpointer data);

Shows the corresponding url in the default browser.

dialog :

a GtkAboutDialog

url :

the url to show

data :

useless data variable

gtranslator_utils_activate_email ()

void                gtranslator_utils_activate_email    (GtkAboutDialog *dialog,
                                                         const gchar *email,
                                                         gpointer data);

Shows the corresponding email in the default mailer.

dialog :

a GtkAboutDialog

email :

the email to show

data :

useless data variable

gtranslator_utils_help_display ()

void                gtranslator_utils_help_display      (GtkWindow *parent,
                                                         const gchar *doc_id,
                                                         const gchar *file_name);

Shows the help for an specific document in the default help browser.

parent :

a GtkWindow

doc_id :

the name of the type of doc

file_name :

the name of the doc

gtranslator_utils_get_user_config_dir ()

gchar*              gtranslator_utils_get_user_config_dir
                                                        (void);

Returns the default config dir for gtranslator.

Returns :

the config dir for gtranslator.

gtranslator_utils_get_current_date ()

gchar*              gtranslator_utils_get_current_date  (void);

Returns :


gtranslator_utils_get_current_time ()

gchar*              gtranslator_utils_get_current_time  (void);

Returns :


gtranslator_utils_get_current_year ()

gchar*              gtranslator_utils_get_current_year  (void);

Returns :


gtranslator_utils_scan_dir ()

void                gtranslator_utils_scan_dir          (GFile *dir,
                                                         GSList **list,
                                                         const gchar *po_name);

Scans the directory and subdirectories of dir looking for filenames remained with .po or files that matches po_name. The contents of list must be freed with g_slist_foreach (list, (GFunc)g_object_unref, NULL).

dir :

the dir to parse

list :

the list where to store the GFiles

po_name :

the name of the specific po file to search or NULL.

gtranslator_utils_reduce_path ()

gchar*              gtranslator_utils_reduce_path       (const gchar *path);

path :

Returns :