Kill gedit-language-manager and use directly gtksourcelanguagemanager

parent 49e5942e
......@@ -118,7 +118,6 @@ NOINST_H_FILES = \
gedit-floating-slider.h \
gedit-history-entry.h \
gedit-io-error-info-bar.h \
gedit-language-manager.h \
gedit-multi-notebook.h \
gedit-notebook.h \
gedit-notebook-popup-menu.h \
......@@ -205,7 +204,6 @@ libgedit_c_files = \
gedit-floating-slider.c \
gedit-history-entry.c \
gedit-io-error-info-bar.c \
gedit-language-manager.c \
gedit-message-bus.c \
gedit-message.c \
gedit-multi-notebook.c \
......
......@@ -44,7 +44,6 @@
#include "gedit-document.h"
#include "gedit-debug.h"
#include "gedit-utils.h"
#include "gedit-language-manager.h"
#include "gedit-document-loader.h"
#include "gedit-document-saver.h"
#include "gedit-marshal.h"
......@@ -878,7 +877,7 @@ guess_language (GeditDocument *doc,
if (strcmp (data, "_NORMAL_") != 0)
{
language = gtk_source_language_manager_get_language (
gedit_get_language_manager (),
gtk_source_language_manager_get_default (),
data);
}
......@@ -902,7 +901,7 @@ guess_language (GeditDocument *doc,
}
language = gtk_source_language_manager_guess_language (
gedit_get_language_manager (),
gtk_source_language_manager_get_default (),
basename,
content_type);
......
......@@ -39,10 +39,10 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <gtksourceview/gtksourcelanguagemanager.h>
#include "gedit-file-chooser-dialog.h"
#include "gedit-encodings-combo-box.h"
#include "gedit-language-manager.h"
#include "gedit-debug.h"
#include "gedit-enum-types.h"
#include "gedit-settings.h"
......@@ -290,7 +290,7 @@ all_text_files_filter (const GtkFileFilterInfo *filter_info,
GtkSourceLanguageManager *lm;
const gchar * const *languages;
lm = gedit_get_language_manager ();
lm = gtk_source_language_manager_get_default ();
languages = gtk_source_language_manager_get_language_ids (lm);
while ((languages != NULL) && (*languages != NULL))
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* gedit-languages-manager.c
* This file is part of gedit
*
* Copyright (C) 2003-2006 - Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the gedit Team, 2003-2006. See the AUTHORS file for a
* list of people on the gedit Team.
* See the ChangeLog files for a list of changes.
*
* $Id$
*/
#include <string.h>
#include "gedit-language-manager.h"
#include "gedit-utils.h"
#include "gedit-debug.h"
static GtkSourceLanguageManager *language_manager = NULL;
GtkSourceLanguageManager *
gedit_get_language_manager (void)
{
if (language_manager == NULL)
{
language_manager = gtk_source_language_manager_new ();
}
return language_manager;
}
/* ex:set ts=8 noet: */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* gedit-languages-manager.h
* This file is part of gedit
*
* Copyright (C) 2003-2005 - Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the gedit Team, 2003-2005. See the AUTHORS file for a
* list of people on the gedit Team.
* See the ChangeLog files for a list of changes.
*
* $Id$
*/
#ifndef __GEDIT_LANGUAGES_MANAGER_H__
#define __GEDIT_LANGUAGES_MANAGER_H__
#include <gtksourceview/gtksourcelanguagemanager.h>
G_BEGIN_DECLS
GtkSourceLanguageManager *gedit_get_language_manager (void);
G_END_DECLS
#endif /* __GEDIT_LANGUAGES_MANAGER_H__ */
/* ex:set ts=8 noet: */
......@@ -38,6 +38,7 @@
#include <glib/gi18n.h>
#include <gio/gio.h>
#include <gtksourceview/gtksourcelanguagemanager.h>
#include <libpeas/peas-extension-set.h>
#include "gedit-ui.h"
......@@ -51,7 +52,6 @@
#include "gedit-utils.h"
#include "gedit-commands.h"
#include "gedit-debug.h"
#include "gedit-language-manager.h"
#include "gedit-panel.h"
#include "gedit-documents-panel.h"
#include "gedit-plugins-engine.h"
......@@ -857,7 +857,7 @@ language_toggled (GtkToggleAction *action,
else
{
lang = gtk_source_language_manager_get_language (
gedit_get_language_manager (),
gtk_source_language_manager_get_default (),
lang_id);
if (lang == NULL)
{
......@@ -1014,7 +1014,7 @@ get_languages_sorted_by_section (GeditWindow *window)
gint i;
GSList *languages = NULL;
lm = gedit_get_language_manager ();
lm = gtk_source_language_manager_get_default ();
ids = gtk_source_language_manager_get_language_ids (lm);
for (i = 0; ids[i] != NULL; i++)
......@@ -2097,7 +2097,7 @@ fill_language_combo (GeditWindow *window)
GTK_MENU_ITEM (menu_item),
name);
lm = gedit_get_language_manager ();
lm = gtk_source_language_manager_get_default ();
ids = gtk_source_language_manager_get_language_ids (lm);
for (i = 0; ids[i] != NULL; i++)
......
......@@ -22,7 +22,7 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <gedit/gedit-language-manager.h>
#include <gtksourceview/gtksourcelanguagemanager.h>
#include <gedit/gedit-debug.h>
#include <gedit/gedit-document.h>
#include <gedit/gedit-settings.h>
......@@ -761,7 +761,7 @@ modeline_parser_apply_modeline (GtkSourceView *view)
GtkSourceLanguageManager *manager;
GtkSourceLanguage *language;
manager = gedit_get_language_manager ();
manager = gtk_source_language_manager_get_default ();
language = gtk_source_language_manager_get_language
(manager, options.language_id);
......
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