2006-05-04 01:40:54 -05:00
|
|
|
/*
|
2005-10-17 05:23:40 +00:00
|
|
|
* moolangmgr.h
|
|
|
|
*
|
2010-12-21 20:15:45 -08:00
|
|
|
* Copyright (C) 2004-2010 by Yevgen Muntyan <emuntyan@users.sourceforge.net>
|
2005-10-17 05:23:40 +00:00
|
|
|
*
|
2008-09-05 17:20:50 -05:00
|
|
|
* This file is part of medit. medit is free software; you can
|
|
|
|
* redistribute it and/or modify it under the terms of the
|
|
|
|
* GNU Lesser General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2.1 of the License,
|
|
|
|
* or (at your option) any later version.
|
2005-10-17 05:23:40 +00:00
|
|
|
*
|
2008-09-05 17:20:50 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with medit. If not, see <http://www.gnu.org/licenses/>.
|
2005-10-17 05:23:40 +00:00
|
|
|
*/
|
|
|
|
|
2007-06-10 04:06:03 -05:00
|
|
|
#ifndef MOO_LANG_MGR_H
|
|
|
|
#define MOO_LANG_MGR_H
|
2005-10-17 05:23:40 +00:00
|
|
|
|
|
|
|
#include <mooedit/moolang.h>
|
2006-08-26 04:46:29 -05:00
|
|
|
#include <mooedit/mootextstylescheme.h>
|
|
|
|
#include <mooedit/mooeditconfig.h>
|
2016-01-02 07:09:54 -08:00
|
|
|
|
2005-10-17 05:23:40 +00:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
|
|
|
#define MOO_TYPE_LANG_MGR (moo_lang_mgr_get_type ())
|
|
|
|
#define MOO_LANG_MGR(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), MOO_TYPE_LANG_MGR, MooLangMgr))
|
|
|
|
#define MOO_IS_LANG_MGR(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), MOO_TYPE_LANG_MGR))
|
|
|
|
|
2010-12-12 02:29:20 -08:00
|
|
|
typedef struct MooLangMgr MooLangMgr;
|
2005-10-17 05:23:40 +00:00
|
|
|
|
2006-08-26 04:46:29 -05:00
|
|
|
|
2005-10-17 05:23:40 +00:00
|
|
|
GType moo_lang_mgr_get_type (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
MooLangMgr *moo_lang_mgr_new (void);
|
2008-08-26 13:51:05 -05:00
|
|
|
MooLangMgr *moo_lang_mgr_default (void);
|
2005-10-17 05:23:40 +00:00
|
|
|
|
2016-10-02 21:14:12 -07:00
|
|
|
MooLang *moo_lang_mgr_get_lang (MooLangMgr *mgr,
|
|
|
|
const char *lang_id);
|
|
|
|
MooLang *moo_lang_mgr_get_lang_for_file (MooLangMgr *mgr,
|
|
|
|
GFile *file);
|
2006-08-26 04:46:29 -05:00
|
|
|
|
|
|
|
/* list must be freed, content unref'ed */
|
2016-10-02 21:14:12 -07:00
|
|
|
GSList *moo_lang_mgr_get_available_langs (MooLangMgr *mgr);
|
2006-08-26 04:46:29 -05:00
|
|
|
/* list must be freed together with content */
|
2016-10-02 21:14:12 -07:00
|
|
|
GSList *moo_lang_mgr_get_sections (MooLangMgr *mgr);
|
2006-08-26 04:46:29 -05:00
|
|
|
|
2016-10-02 21:14:12 -07:00
|
|
|
MooLang *_moo_lang_mgr_find_lang (MooLangMgr *mgr,
|
|
|
|
const char *name);
|
2006-12-04 22:55:42 -06:00
|
|
|
|
2016-10-02 21:14:12 -07:00
|
|
|
MooTextStyleScheme *moo_lang_mgr_get_active_scheme (MooLangMgr *mgr);
|
|
|
|
void _moo_lang_mgr_set_active_scheme (MooLangMgr *mgr,
|
|
|
|
const char *scheme_name);
|
2006-08-26 04:46:29 -05:00
|
|
|
/* list must be freed, content unref'ed */
|
2016-10-02 21:14:12 -07:00
|
|
|
GSList *moo_lang_mgr_list_schemes (MooLangMgr *mgr);
|
2006-08-26 04:46:29 -05:00
|
|
|
|
|
|
|
/* list must be freed together with content */
|
2016-10-02 21:14:12 -07:00
|
|
|
GSList *_moo_lang_mgr_get_globs (MooLangMgr *mgr,
|
|
|
|
const char *lang_id);
|
2006-05-02 23:26:05 -05:00
|
|
|
/* list must be freed together with content */
|
2016-10-02 21:14:12 -07:00
|
|
|
GSList *_moo_lang_mgr_get_mime_types (MooLangMgr *mgr,
|
|
|
|
const char *lang_id);
|
|
|
|
void _moo_lang_mgr_set_mime_types (MooLangMgr *mgr,
|
|
|
|
const char *lang_id,
|
|
|
|
const char *mime);
|
|
|
|
void _moo_lang_mgr_set_globs (MooLangMgr *mgr,
|
|
|
|
const char *lang_id,
|
|
|
|
const char *globs);
|
|
|
|
const char *_moo_lang_mgr_get_config (MooLangMgr *mgr,
|
|
|
|
const char *lang_id);
|
|
|
|
void _moo_lang_mgr_set_config (MooLangMgr *mgr,
|
|
|
|
const char *lang_id,
|
|
|
|
const char *config);
|
|
|
|
void _moo_lang_mgr_update_config (MooLangMgr *mgr,
|
|
|
|
MooEditConfig *config,
|
|
|
|
const char *lang_id);
|
|
|
|
void _moo_lang_mgr_save_config (MooLangMgr *mgr);
|
2006-08-23 20:33:03 -05:00
|
|
|
|
2005-10-17 05:23:40 +00:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
2007-06-10 04:06:03 -05:00
|
|
|
#endif /* MOO_LANG_MGR_H */
|