Commit 2dd69b99 authored by Sébastien Wilmet's avatar Sébastien Wilmet

Port to GtkSourceEncoding

parent 5ea94c46
......@@ -89,7 +89,7 @@ struct _GeditAppPrivate
static gboolean new_window = FALSE;
static gboolean new_document = FALSE;
static gchar *geometry = NULL;
static const GeditEncoding *encoding = NULL;
static const GtkSourceEncoding *encoding = NULL;
static GInputStream *stdin_stream = NULL;
static GSList *file_list = NULL;
static gint line_position = 0;
......@@ -872,7 +872,7 @@ gedit_app_command_line (GApplication *application,
if (g_variant_dict_lookup (options, "encoding", "&s", &encoding_charset))
{
encoding = gedit_encoding_get_from_charset (encoding_charset);
encoding = gtk_source_encoding_get_from_charset (encoding_charset);
if (encoding == NULL)
{
......@@ -927,6 +927,13 @@ gedit_app_command_line (GApplication *application,
return 0;
}
static void
encoding_foreach_cb (const GtkSourceEncoding *encoding,
gpointer user_data)
{
g_print ("%s\n", gtk_source_encoding_get_charset (encoding));
}
static gint
gedit_app_handle_local_options (GApplication *application,
GVariantDict *options)
......@@ -939,16 +946,7 @@ gedit_app_handle_local_options (GApplication *application,
if (g_variant_dict_contains (options, "list-encodings"))
{
gint i = 0;
const GeditEncoding *enc;
while ((enc = gedit_encoding_get_from_index (i)) != NULL)
{
g_print ("%s\n", gedit_encoding_get_charset (enc));
++i;
}
gtk_source_encoding_foreach (encoding_foreach_cb, NULL);
return 0;
}
......
......@@ -24,8 +24,6 @@
#include <config.h>
#endif
#include <string.h> /* For strlen and strcmp */
#include <glib/gi18n.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
......@@ -115,12 +113,12 @@ is_duplicated_file (GSList *files,
/* File loading */
static GSList *
load_file_list (GeditWindow *window,
const GSList *files,
const GeditEncoding *encoding,
gint line_pos,
gint column_pos,
gboolean create)
load_file_list (GeditWindow *window,
const GSList *files,
const GtkSourceEncoding *encoding,
gint line_pos,
gint column_pos,
gboolean create)
{
GeditTab *tab;
GSList *loaded_files = NULL; /* Number of files to load */
......@@ -284,18 +282,18 @@ load_file_list (GeditWindow *window,
* gedit_commands_load_location:
* @window: a #GeditWindow
* @location: a #GFile to be loaded
* @encoding: (allow-none): the #GeditEncoding of @location
* @encoding: (allow-none): the #GtkSourceEncoding of @location
* @line_pos: the line position to place the cursor when @location is loaded
* @column_pos: the line column to place the cursor when @location is loaded
*
* Loads @location. Ignores non-existing locations
*/
void
gedit_commands_load_location (GeditWindow *window,
GFile *location,
const GeditEncoding *encoding,
gint line_pos,
gint column_pos)
gedit_commands_load_location (GeditWindow *window,
GFile *location,
const GtkSourceEncoding *encoding,
gint line_pos,
gint column_pos)
{
GSList *locations = NULL;
gchar *uri;
......@@ -321,7 +319,7 @@ gedit_commands_load_location (GeditWindow *window,
* gedit_commands_load_locations:
* @window: a #GeditWindow
* @locations: (element-type Gio.File): the locations to be loaded
* @encoding: (allow-none): the #GeditEncoding of @location
* @encoding: (allow-none): the #GtkSourceEncoding of @location
* @line_pos: the line position to place the cursor when @location is loaded
* @column_pos: the line column to place the cursor when @location is loaded
*
......@@ -330,11 +328,11 @@ gedit_commands_load_location (GeditWindow *window,
* Returns: (element-type Gedit.Document) (transfer container): the locations that were loaded
*/
GSList *
gedit_commands_load_locations (GeditWindow *window,
const GSList *locations,
const GeditEncoding *encoding,
gint line_pos,
gint column_pos)
gedit_commands_load_locations (GeditWindow *window,
const GSList *locations,
const GtkSourceEncoding *encoding,
gint line_pos,
gint column_pos)
{
g_return_val_if_fail (GEDIT_IS_WINDOW (window), 0);
g_return_val_if_fail ((locations != NULL) && (locations->data != NULL), 0);
......@@ -350,11 +348,11 @@ gedit_commands_load_locations (GeditWindow *window,
* titled document.
*/
GSList *
_gedit_cmd_load_files_from_prompt (GeditWindow *window,
GSList *files,
const GeditEncoding *encoding,
gint line_pos,
gint column_pos)
_gedit_cmd_load_files_from_prompt (GeditWindow *window,
GSList *files,
const GtkSourceEncoding *encoding,
gint line_pos,
gint column_pos)
{
gedit_debug (DEBUG_COMMANDS);
......@@ -378,7 +376,7 @@ open_dialog_response_cb (GeditFileChooserDialog *dialog,
GeditWindow *window)
{
GSList *files;
const GeditEncoding *encoding;
const GtkSourceEncoding *encoding;
GSList *loaded;
gedit_debug (DEBUG_COMMANDS);
......@@ -702,7 +700,7 @@ save_dialog_response_cb (GeditFileChooserDialog *dialog,
GeditDocumentNewlineType newline_type;
GeditDocumentCompressionType compression_type;
GeditDocumentCompressionType current_compression_type;
const GeditEncoding *encoding;
const GtkSourceEncoding *encoding;
doc = gedit_tab_get_document (tab);
......@@ -834,7 +832,7 @@ _gedit_cmd_file_save_as_tab (GeditTab *tab,
GtkWindowGroup *wg;
GeditDocument *doc;
GFile *file;
const GeditEncoding *encoding;
const GtkSourceEncoding *encoding;
GeditDocumentNewlineType newline_type;
g_return_if_fail (GEDIT_IS_TAB (tab));
......
......@@ -24,25 +24,25 @@
#ifndef __GEDIT_COMMANDS_H__
#define __GEDIT_COMMANDS_H__
#include <gtk/gtk.h>
#include <gtksourceview/gtksource.h>
#include <gedit/gedit-window.h>
#include <gedit/gedit-notebook.h>
G_BEGIN_DECLS
/* Do nothing if URI does not exist */
void gedit_commands_load_location (GeditWindow *window,
GFile *location,
const GeditEncoding *encoding,
gint line_pos,
gint column_pos);
void gedit_commands_load_location (GeditWindow *window,
GFile *location,
const GtkSourceEncoding *encoding,
gint line_pos,
gint column_pos);
/* Ignore non-existing URIs */
GSList *gedit_commands_load_locations (GeditWindow *window,
const GSList *locations,
const GeditEncoding *encoding,
gint line_pos,
gint column_pos) G_GNUC_WARN_UNUSED_RESULT;
GSList *gedit_commands_load_locations (GeditWindow *window,
const GSList *locations,
const GtkSourceEncoding *encoding,
gint line_pos,
gint column_pos) G_GNUC_WARN_UNUSED_RESULT;
void gedit_commands_save_document (GeditWindow *window,
GeditDocument *document);
......@@ -54,11 +54,11 @@ void gedit_commands_save_all_documents (GeditWindow *window);
*/
/* Create titled documens for non-existing URIs */
GSList *_gedit_cmd_load_files_from_prompt (GeditWindow *window,
GSList *files,
const GeditEncoding *encoding,
gint line_pos,
gint column_pos) G_GNUC_WARN_UNUSED_RESULT;
GSList *_gedit_cmd_load_files_from_prompt (GeditWindow *window,
GSList *files,
const GtkSourceEncoding *encoding,
gint line_pos,
gint column_pos) G_GNUC_WARN_UNUSED_RESULT;
void _gedit_cmd_file_new (GSimpleAction *action,
GVariant *parameter,
......
......@@ -24,10 +24,10 @@
#endif
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <gtksourceview/gtksource.h>
#include <gedit/gedit-encodings-combo-box.h>
#include <gedit/gedit-encodings-dialog.h>
#include "gedit-encodings-combo-box.h"
#include "gedit-encodings-dialog.h"
#include "gedit-settings.h"
#include "gedit-utils.h"
......@@ -261,8 +261,8 @@ update_menu (GeditEncodingsComboBox *menu)
GtkTreeIter iter;
GSList *encodings, *l;
gchar *str;
const GeditEncoding *utf8_encoding;
const GeditEncoding *current_encoding;
const GtkSourceEncoding *utf8_encoding;
const GtkSourceEncoding *current_encoding;
gchar **enc_strv;
store = menu->priv->store;
......@@ -273,8 +273,8 @@ update_menu (GeditEncodingsComboBox *menu)
gtk_combo_box_set_model (GTK_COMBO_BOX (menu),
NULL);
utf8_encoding = gedit_encoding_get_utf8 ();
current_encoding = gedit_encoding_get_current ();
utf8_encoding = gtk_source_encoding_get_utf8 ();
current_encoding = gtk_source_encoding_get_current ();
if (!menu->priv->save_mode)
{
......@@ -295,12 +295,12 @@ update_menu (GeditEncodingsComboBox *menu)
if (current_encoding != utf8_encoding)
{
str = gedit_encoding_to_string (utf8_encoding);
str = gtk_source_encoding_to_string (utf8_encoding);
}
else
{
str = g_strdup_printf (_("Current Locale (%s)"),
gedit_encoding_get_charset (utf8_encoding));
gtk_source_encoding_get_charset (utf8_encoding));
}
gtk_list_store_append (store, &iter);
......@@ -316,7 +316,7 @@ update_menu (GeditEncodingsComboBox *menu)
(current_encoding != NULL))
{
str = g_strdup_printf (_("Current Locale (%s)"),
gedit_encoding_get_charset (current_encoding));
gtk_source_encoding_get_charset (current_encoding));
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
......@@ -336,13 +336,13 @@ update_menu (GeditEncodingsComboBox *menu)
for (l = encodings; l != NULL; l = g_slist_next (l))
{
const GeditEncoding *enc = (const GeditEncoding *)l->data;
const GtkSourceEncoding *enc = l->data;
if ((enc != current_encoding) &&
(enc != utf8_encoding) &&
(enc != NULL))
{
str = gedit_encoding_to_string (enc);
str = gtk_source_encoding_to_string (enc);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
......@@ -409,7 +409,7 @@ gedit_encodings_combo_box_new (gboolean save_mode)
NULL);
}
const GeditEncoding *
const GtkSourceEncoding *
gedit_encodings_combo_box_get_selected_encoding (GeditEncodingsComboBox *menu)
{
GtkTreeIter iter;
......@@ -418,7 +418,7 @@ gedit_encodings_combo_box_get_selected_encoding (GeditEncodingsComboBox *menu)
if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (menu), &iter))
{
const GeditEncoding *ret;
const GtkSourceEncoding *ret;
GtkTreeModel *model;
model = gtk_combo_box_get_model (GTK_COMBO_BOX (menu));
......@@ -439,8 +439,8 @@ gedit_encodings_combo_box_get_selected_encoding (GeditEncodingsComboBox *menu)
* @encoding: (allow-none):
**/
void
gedit_encodings_combo_box_set_selected_encoding (GeditEncodingsComboBox *menu,
const GeditEncoding *encoding)
gedit_encodings_combo_box_set_selected_encoding (GeditEncodingsComboBox *menu,
const GtkSourceEncoding *encoding)
{
GtkTreeIter iter;
GtkTreeModel *model;
......@@ -453,7 +453,7 @@ gedit_encodings_combo_box_set_selected_encoding (GeditEncodingsComboBox *menu,
while (b)
{
const GeditEncoding *enc;
const GtkSourceEncoding *enc;
gtk_tree_model_get (model, &iter,
ENCODING_COLUMN, &enc,
......
......@@ -42,24 +42,24 @@ typedef struct _GeditEncodingsComboBoxPrivate GeditEncodingsComboBoxPrivate;
struct _GeditEncodingsComboBox
{
GtkComboBox parent;
GtkComboBox parent;
GeditEncodingsComboBoxPrivate *priv;
GeditEncodingsComboBoxPrivate *priv;
};
struct _GeditEncodingsComboBoxClass
{
GtkComboBoxClass parent_class;
GtkComboBoxClass parent_class;
};
GType gedit_encodings_combo_box_get_type (void) G_GNUC_CONST;
GType gedit_encodings_combo_box_get_type (void) G_GNUC_CONST;
/* Constructor */
GtkWidget *gedit_encodings_combo_box_new (gboolean save_mode);
GtkWidget *gedit_encodings_combo_box_new (gboolean save_mode);
const GeditEncoding *gedit_encodings_combo_box_get_selected_encoding (GeditEncodingsComboBox *menu);
void gedit_encodings_combo_box_set_selected_encoding (GeditEncodingsComboBox *menu,
const GeditEncoding *encoding);
const GtkSourceEncoding *gedit_encodings_combo_box_get_selected_encoding (GeditEncodingsComboBox *menu);
void gedit_encodings_combo_box_set_selected_encoding (GeditEncodingsComboBox *menu,
const GtkSourceEncoding *encoding);
G_END_DECLS
......
......@@ -24,12 +24,10 @@
#include <string.h>
#include <glib.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <gtksourceview/gtksource.h>
#include "gedit-encodings-dialog.h"
#include "gedit-encodings.h"
#include "gedit-utils.h"
#include "gedit-debug.h"
#include "gedit-dirs.h"
......@@ -182,12 +180,12 @@ get_selected_encodings_func (GtkTreeModel *model,
{
GSList **list = data;
gchar *charset;
const GeditEncoding *enc;
const GtkSourceEncoding *enc;
charset = NULL;
gtk_tree_model_get (model, iter, COLUMN_CHARSET, &charset, -1);
enc = gedit_encoding_get_from_charset (charset);
enc = gtk_source_encoding_get_from_charset (charset);
g_free (charset);
*list = g_slist_prepend (*list, (gpointer)enc);
......@@ -203,16 +201,16 @@ update_shown_in_menu_tree_model (GtkListStore *store,
while (list != NULL)
{
const GeditEncoding *enc;
const GtkSourceEncoding *enc;
enc = (const GeditEncoding*) list->data;
enc = list->data;
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
COLUMN_CHARSET,
gedit_encoding_get_charset (enc),
gtk_source_encoding_get_charset (enc),
COLUMN_NAME,
gedit_encoding_get_name (enc), -1);
gtk_source_encoding_get_name (enc), -1);
list = g_slist_next (list);
}
......@@ -296,9 +294,7 @@ init_shown_in_menu_tree_model (GeditEncodingsDialog *dialog)
for (tmp = list; tmp != NULL; tmp = g_slist_next (tmp))
{
const GeditEncoding *enc;
enc = (const GeditEncoding *) tmp->data;
const GtkSourceEncoding *enc = tmp->data;
dialog->priv->show_in_menu_list = g_slist_prepend (dialog->priv->show_in_menu_list,
tmp->data);
......@@ -308,21 +304,39 @@ init_shown_in_menu_tree_model (GeditEncodingsDialog *dialog)
gtk_list_store_set (dialog->priv->displayed_liststore,
&iter,
COLUMN_CHARSET,
gedit_encoding_get_charset (enc),
gtk_source_encoding_get_charset (enc),
COLUMN_NAME,
gedit_encoding_get_name (enc), -1);
gtk_source_encoding_get_name (enc), -1);
}
g_slist_free (list);
}
static void
insert_encoding_foreach_cb (const GtkSourceEncoding *encoding,
GeditEncodingsDialog *dlg)
{
GtkTreeIter iter;
if (encoding == gtk_source_encoding_get_utf8 ())
{
/* The UTF-8 encoding is always added to the combobox. */
return;
}
gtk_list_store_append (dlg->priv->available_liststore, &iter);
gtk_list_store_set (dlg->priv->available_liststore,
&iter,
COLUMN_CHARSET, gtk_source_encoding_get_charset (encoding),
COLUMN_NAME, gtk_source_encoding_get_name (encoding),
-1);
}
static void
gedit_encodings_dialog_init (GeditEncodingsDialog *dlg)
{
GtkTreeIter parent_iter;
GtkTreeSelection *selection;
const GeditEncoding *enc;
int i;
dlg->priv = gedit_encodings_dialog_get_instance_private (dlg);
......@@ -345,20 +359,8 @@ gedit_encodings_dialog_init (GeditEncodingsDialog *dlg)
/* Tree view of available encodings */
/* Add the data */
i = 0;
while ((enc = gedit_encoding_get_from_index (i)) != NULL)
{
gtk_list_store_append (dlg->priv->available_liststore,
&parent_iter);
gtk_list_store_set (dlg->priv->available_liststore,
&parent_iter,
COLUMN_CHARSET,
gedit_encoding_get_charset (enc),
COLUMN_NAME,
gedit_encoding_get_name (enc), -1);
++i;
}
gtk_source_encoding_foreach ((GtkSourceEncodingForeachFunc) insert_encoding_foreach_cb,
dlg);
/* Sort model */
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (dlg->priv->sort_available),
......
......@@ -28,8 +28,6 @@
#include <string.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <gtksourceview/gtksource.h>
#include "gedit-file-chooser-dialog.h"
#include "gedit-encodings-combo-box.h"
......@@ -350,12 +348,12 @@ gedit_file_chooser_dialog_init (GeditFileChooserDialog *dialog)
}
static GtkWidget *
gedit_file_chooser_dialog_new_valist (const gchar *title,
GtkWindow *parent,
GtkFileChooserAction action,
const GeditEncoding *encoding,
const gchar *first_button_text,
va_list varargs)
gedit_file_chooser_dialog_new_valist (const gchar *title,
GtkWindow *parent,
GtkFileChooserAction action,
const GtkSourceEncoding *encoding,
const gchar *first_button_text,
va_list varargs)
{
GtkWidget *result;
const char *button_text = first_button_text;
......@@ -461,11 +459,11 @@ gedit_file_chooser_dialog_new_valist (const gchar *title,
* Return value: a new #GeditFileChooserDialog
*/
GtkWidget *
gedit_file_chooser_dialog_new (const gchar *title,
GtkWindow *parent,
GtkFileChooserAction action,
const GeditEncoding *encoding,
const gchar *first_button_text,
gedit_file_chooser_dialog_new (const gchar *title,
GtkWindow *parent,
GtkFileChooserAction action,
const GtkSourceEncoding *encoding,
const gchar *first_button_text,
...)
{
GtkWidget *result;
......@@ -481,8 +479,8 @@ gedit_file_chooser_dialog_new (const gchar *title,
}
void
gedit_file_chooser_dialog_set_encoding (GeditFileChooserDialog *dialog,
const GeditEncoding *encoding)
gedit_file_chooser_dialog_set_encoding (GeditFileChooserDialog *dialog,
const GtkSourceEncoding *encoding)
{
g_return_if_fail (GEDIT_IS_FILE_CHOOSER_DIALOG (dialog));
g_return_if_fail (GEDIT_IS_ENCODINGS_COMBO_BOX (dialog->priv->option_menu));
......@@ -492,7 +490,7 @@ gedit_file_chooser_dialog_set_encoding (GeditFileChooserDialog *dialog,
encoding);
}
const GeditEncoding *
const GtkSourceEncoding *
gedit_file_chooser_dialog_get_encoding (GeditFileChooserDialog *dialog)
{
g_return_val_if_fail (GEDIT_IS_FILE_CHOOSER_DIALOG (dialog), NULL);
......
......@@ -21,9 +21,8 @@
#ifndef __GEDIT_FILE_CHOOSER_DIALOG_H__
#define __GEDIT_FILE_CHOOSER_DIALOG_H__
#include <gtk/gtk.h>
#include <gtksourceview/gtksource.h>
#include <gedit/gedit-encodings.h>
#include <gedit/gedit-enum-types.h>
#include <gedit/gedit-document.h>
......@@ -57,14 +56,14 @@ GType gedit_file_chooser_dialog_get_type (void) G_GNUC_CONST;
GtkWidget *gedit_file_chooser_dialog_new (const gchar *title,
GtkWindow *parent,
GtkFileChooserAction action,
const GeditEncoding *encoding,
const GtkSourceEncoding *encoding,
const gchar *first_button_text,
...);
void gedit_file_chooser_dialog_set_encoding (GeditFileChooserDialog *dialog,
const GeditEncoding *encoding);
const GtkSourceEncoding *encoding);
const GeditEncoding
const GtkSourceEncoding
*gedit_file_chooser_dialog_get_encoding (GeditFileChooserDialog *dialog);
void gedit_file_chooser_dialog_set_newline_type (GeditFileChooserDialog *dialog,
......
......@@ -583,9 +583,9 @@ create_conversion_error_info_bar (const gchar *primary_text,
}
GtkWidget *
gedit_io_loading_error_info_bar_new (GFile *location,
const GeditEncoding *encoding,
const GError *error)
gedit_io_loading_error_info_bar_new (GFile *location,
const GtkSourceEncoding *encoding,
const GError *error)
{
gchar *error_message = NULL;
gchar *message_details = NULL;
......@@ -623,7 +623,7 @@ gedit_io_loading_error_info_bar_new (GFile *location,
g_free (temp_uri_for_display);
if (encoding != NULL)
encoding_name = gedit_encoding_to_string (encoding);
encoding_name = gtk_source_encoding_to_string (encoding);
else
encoding_name = g_strdup ("UTF-8");
......@@ -699,9 +699,9 @@ gedit_io_loading_error_info_bar_new (GFile *location,
}
GtkWidget *
gedit_conversion_error_while_saving_info_bar_new (GFile *location,
const GeditEncoding *encoding,
const GError *error)
gedit_conversion_error_while_saving_info_bar_new (GFile *location,
const GtkSourceEncoding *encoding,
const GError *error)
{
gchar *error_message = NULL;
gchar *message_details = NULL;
......@@ -730,7 +730,7 @@ gedit_conversion_error_while_saving_info_bar_new (GFile *location,
uri_for_display = g_markup_escape_text (temp_uri_for_display, -1);
g_free (temp_uri_for_display);
encoding_name = gedit_encoding_to_string (encoding);
encoding_name = gtk_source_encoding_to_string (encoding);
error_message = g_strdup_printf (_("Could not save the file “%s” using the “%s” character encoding."),
uri_for_display,
......@@ -751,7 +751,7 @@ gedit_conversion_error_while_saving_info_bar_new (GFile *location,
return info_bar;
}
const GeditEncoding *
const GtkSourceEncoding *
gedit_conversion_error_info_bar_get_encoding (GtkWidget *info_bar)
{
gpointer menu;
......
......@@ -21,22 +21,22 @@
#ifndef __GEDIT_IO_ERROR_INFO_BAR_H__
#define __GEDIT_IO_ERROR_INFO_BAR_H__
#include <glib.h>
#include <gtksourceview/gtksource.h>
G_BEGIN_DECLS
GtkWidget *gedit_io_loading_error_info_bar_new (GFile *location,
const GeditEncoding *encoding,
const GError *error);
GtkWidget *gedit_io_loading_error_info_bar_new (GFile *location,
const GtkSourceEncoding *encoding,
const GError *error);
GtkWidget *gedit_unrecoverable_reverting_error_info_bar_new (GFile *location,
const GError *error);
GtkWidget *gedit_conversion_error_while_saving_info_bar_new (GFile *location,
const GeditEncoding *encoding,
const GError *error);
GtkWidget *gedit_conversion_error_while_saving_info_bar_new (GFile *location,
const GtkSourceEncoding *encoding,
const GError *error);
const GeditEncoding
const GtkSourceEncoding
*gedit_conversion_error_info_bar_get_encoding (GtkWidget *info_bar);
GtkWidget *gedit_file_already_open_warning_info_bar_new (GFile *location);
......
......@@ -59,7 +59,7 @@ struct _GeditTabPrivate
/* tmp data for loading */
gint tmp_line_pos;
gint tmp_column_pos;
const GeditEncoding *tmp_encoding;
const GtkSourceEncoding *tmp_encoding;
GTimer *timer;
......@@ -562,7 +562,7 @@ io_loading_error_info_bar_response (GtkWidget *info_bar,
GeditDocument *doc;
GeditView *view;
GFile *location;
const GeditEncoding *encoding;
const GtkSourceEncoding *encoding;
doc = gedit_tab_get_document (tab);
view = gedit_tab_get_view (tab);
......@@ -1297,7 +1297,7 @@ recoverable_saving_error_info_bar_response (GtkWidget *info_bar,
if (response_id == GTK_RESPONSE_OK)
{
const GeditEncoding *encoding;
const GtkSourceEncoding *encoding;
gchar *tmp_uri;
encoding = gedit_conversion_error_info_bar_get_encoding (GTK_WIDGET (info_bar));
......@@ -1702,11 +1702,11 @@ _gedit_tab_new (void)
/* Whether create is TRUE, creates a new empty document if location does
not refer to an existing location */
GtkWidget *
_gedit_tab_new_from_location (GFile *location,
const GeditEncoding *encoding,
gint line_pos,
gint column_pos,
gboolean create)
_gedit_tab_new_from_location (GFile *location,
const GtkSourceEncoding *encoding,
gint line_pos,
gint column_pos,
gboolean create)
{
GtkWidget *tab;
......@@ -1725,10 +1725,10 @@ _gedit_tab_new_from_location (GFile *location,
}
GtkWidget *
_gedit_tab_new_from_stream (GInputStream *stream,
const GeditEncoding *encoding,
gint line_pos,
gint column_pos)
_gedit_tab_new_from_stream (GInputStream *stream,
const GtkSourceEncoding *encoding,
gint line_pos,
gint column_pos)
{
GtkWidget *tab;
......@@ -1850,7 +1850,7 @@ _gedit_tab_get_tooltip (GeditTab *tab)
gchar *content_description;
gchar *content_full_description;
gchar *encoding;
const GeditEncoding *enc;
const GtkSourceEncoding *enc;
case GEDIT_TAB_STATE_LOADING_ERROR:
tip = g_strdup_printf (_("Error opening file %s"),
......@@ -1886,7 +1886,7 @@ _gedit_tab_get_tooltip (GeditTab *tab)
if (enc == NULL)
encoding = g_strdup (_("Unicode (UTF-8)"));
else
encoding = gedit_encoding_to_string (enc);
encoding = gtk_source_encoding_to_string (enc);
tip = g_markup_printf_escaped ("<b>%s</b> %s\n\n"
"<b>%s</b> %s\n"
......@@ -1976,12 +1976,12 @@ gedit_tab_get_from_document (GeditDocument *doc)
}
void