geany
1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
![]() ![]() |
#include "encodings.h"
Go to the source code of this file.
Classes | |
struct | GeanyEncoding |
Typedefs | |
typedef struct GeanyEncoding | GeanyEncoding |
Enumerations | |
enum | GeanyEncodingGroup { NONE = 0 , WESTEUROPEAN , EASTEUROPEAN , EASTASIAN , ASIAN , MIDDLEEASTERN , UNICODE , GEANY_ENCODING_GROUPS_MAX } |
Functions | |
const GeanyEncoding * | encodings_get_from_charset (const gchar *charset) |
const GeanyEncoding * | encodings_get_from_index (gint idx) |
gchar * | encodings_to_string (const GeanyEncoding *enc) |
const gchar * | encodings_get_charset (const GeanyEncoding *enc) |
void | encodings_select_radio_item (const gchar *charset) |
void | encodings_init (void) |
void | encodings_finalize (void) |
GtkTreeStore * | encodings_encoding_store_new (gboolean has_detect) |
gint | encodings_encoding_store_get_encoding (GtkTreeStore *store, GtkTreeIter *iter) |
gboolean | encodings_encoding_store_get_iter (GtkTreeStore *store, GtkTreeIter *iter, gint enc) |
void | encodings_encoding_store_cell_data_func (GtkCellLayout *cell_layout, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data) |
gboolean | encodings_is_unicode_charset (const gchar *string) |
gboolean | encodings_convert_to_utf8_auto (gchar **buf, gsize *size, const gchar *forced_enc, gchar **used_encoding, gboolean *has_bom, gboolean *partial) |
GeanyEncodingIndex | encodings_scan_unicode_bom (const gchar *string, gsize len, guint *bom_len) |
GeanyEncodingIndex | encodings_get_idx_from_charset (const gchar *charset) |
Variables | |
GeanyEncoding | encodings [GEANY_ENCODINGS_MAX] |
typedef struct GeanyEncoding GeanyEncoding |
enum GeanyEncodingGroup |
Enumerator | |
---|---|
NONE | |
WESTEUROPEAN | |
EASTEUROPEAN | |
EASTASIAN | |
ASIAN | |
MIDDLEEASTERN | |
UNICODE | |
GEANY_ENCODING_GROUPS_MAX |
Definition at line 27 of file encodingsprivate.h.
gboolean encodings_convert_to_utf8_auto | ( | gchar ** | buf, |
gsize * | size, | ||
const gchar * | forced_enc, | ||
gchar ** | used_encoding, | ||
gboolean * | has_bom, | ||
gboolean * | partial | ||
) |
Definition at line 1057 of file encodings.c.
References BufferData::bom, BufferData::data, BufferData::enc, handle_buffer(), BufferData::len, NULL, BufferData::partial, and BufferData::size.
Referenced by load_text_file(), and read_file().
void encodings_encoding_store_cell_data_func | ( | GtkCellLayout * | cell_layout, |
GtkCellRenderer * | cell, | ||
GtkTreeModel * | tree_model, | ||
GtkTreeIter * | iter, | ||
gpointer | data | ||
) |
Definition at line 597 of file encodings.c.
Referenced by prefs_show_dialog(), and ui_create_encodings_combo_box().
gint encodings_encoding_store_get_encoding | ( | GtkTreeStore * | store, |
GtkTreeIter * | iter | ||
) |
Definition at line 574 of file encodings.c.
Referenced by encodings_encoding_store_get_iter(), and ui_encodings_combo_box_get_active_encoding().
gboolean encodings_encoding_store_get_iter | ( | GtkTreeStore * | store, |
GtkTreeIter * | iter, | ||
gint | enc | ||
) |
Definition at line 582 of file encodings.c.
References encodings_encoding_store_get_encoding(), and ui_tree_model_iter_any_next().
Referenced by ui_create_encodings_combo_box(), and ui_encodings_combo_box_set_active_encoding().
GtkTreeStore * encodings_encoding_store_new | ( | gboolean | has_detect | ) |
Definition at line 517 of file encodings.c.
References _, ASIAN, EASTASIAN, EASTEUROPEAN, encoding_combo_store_sort_func(), encodings, encodings_to_string(), GEANY_ENCODINGS_MAX, group, MIDDLEEASTERN, NONE, NULL, UNICODE, and WESTEUROPEAN.
Referenced by prefs_show_dialog(), and ui_create_encodings_combo_box().
void encodings_finalize | ( | void | ) |
Definition at line 391 of file encodings.c.
References pregs, and pregs_loaded.
Referenced by do_main_quit().
const gchar * encodings_get_charset | ( | const GeanyEncoding * | enc | ) |
Definition at line 285 of file encodings.c.
References GeanyEncoding::charset, and NULL.
const GeanyEncoding * encodings_get_from_charset | ( | const gchar * | charset | ) |
Definition at line 215 of file encodings.c.
References encodings, encodings_charset_equals(), GEANY_ENCODING_UTF_8, GEANY_ENCODINGS_MAX, and NULL.
Referenced by encodings_normalize_charset(), and load_dialog_prefs().
const GeanyEncoding * encodings_get_from_index | ( | gint | idx | ) |
Definition at line 247 of file encodings.c.
References encodings, GEANY_ENCODINGS_MAX, and NULL.
GeanyEncodingIndex encodings_get_idx_from_charset | ( | const gchar * | charset | ) |
Definition at line 196 of file encodings.c.
References encodings, encodings_charset_equals(), GEANY_ENCODING_UTF_8, GEANY_ENCODINGS_MAX, and NULL.
Referenced by handle_encoding(), and search_show_find_in_files_dialog_full().
void encodings_init | ( | void | ) |
TODO can it be optimized? ATM 882 runs at line "if (encodings[i].order ...)"
Definition at line 405 of file encodings.c.
References _, ASIAN, EASTASIAN, EASTEUROPEAN, encodings, encodings_radio_item_change_cb(), encodings_reload_radio_item_change_cb(), encodings_to_string(), GEANY_ENCODING_GROUPS_MAX, group, GeanyEncoding::group, groups, gtk_container_add(), gtk_widget_show_all(), init_encodings(), label, main_widgets, MIDDLEEASTERN, N_, NONE, NULL, PATTERN_CODING, PATTERN_HTMLMETA, pregs, pregs_loaded, radio_items, regex_compile(), ui_lookup_widget(), UNICODE, WESTEUROPEAN, and GeanyMainWidgets::window.
Referenced by main_lib().
gboolean encodings_is_unicode_charset | ( | const gchar * | string | ) |
Definition at line 855 of file encodings.c.
References NULL.
Referenced by create_statusbar_statistics(), dialogs_show_file_properties(), document_save_file(), document_set_encoding(), and ui_document_show_hide().
GeanyEncodingIndex encodings_scan_unicode_bom | ( | const gchar * | string, |
gsize | len, | ||
guint * | bom_len | ||
) |
Definition at line 801 of file encodings.c.
References GEANY_ENCODING_NONE, GEANY_ENCODING_UTF_16BE, GEANY_ENCODING_UTF_16LE, GEANY_ENCODING_UTF_32BE, GEANY_ENCODING_UTF_32LE, GEANY_ENCODING_UTF_7, and GEANY_ENCODING_UTF_8.
Referenced by handle_bom(), handle_buffer(), and handle_forced_encoding().
void encodings_select_radio_item | ( | const gchar * | charset | ) |
Definition at line 297 of file encodings.c.
References encodings, GEANY_ENCODING_UTF_8, GEANY_ENCODINGS_MAX, NULL, radio_items, and utils_str_equal().
Referenced by ui_document_show_hide().
gchar * encodings_to_string | ( | const GeanyEncoding * | enc | ) |
Definition at line 275 of file encodings.c.
References GeanyEncoding::charset, GeanyEncoding::name, and NULL.
Referenced by encodings_encoding_store_new(), and encodings_init().
|
extern |
Definition at line 59 of file encodings.c.
Referenced by document_new_file(), document_save_file(), encodings_convert_to_utf8_with_suggestion(), encodings_encoding_store_new(), encodings_get_charset_from_index(), encodings_get_from_charset(), encodings_get_from_index(), encodings_get_idx_from_charset(), encodings_init(), encodings_select_radio_item(), handle_buffer(), handle_encoding(), open_file_dialog_handle_response(), and save_dialog_prefs().