2006-04-20 03:57:05 -05:00
|
|
|
/*
|
2005-09-06 16:21:05 +00:00
|
|
|
* mooedit.h
|
2005-06-22 18:20:32 +00:00
|
|
|
*
|
2010-12-21 20:15:45 -08:00
|
|
|
* Copyright (C) 2004-2010 by Yevgen Muntyan <emuntyan@users.sourceforge.net>
|
2005-06-22 18:20:32 +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-06-22 18:20:32 +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-06-22 18:20:32 +00:00
|
|
|
*/
|
|
|
|
|
2015-12-31 16:41:12 -08:00
|
|
|
#pragma once
|
2005-06-22 18:20:32 +00:00
|
|
|
|
2005-12-08 08:53:46 +00:00
|
|
|
#include <mooedit/mooeditconfig.h>
|
2009-11-01 12:44:46 -08:00
|
|
|
#include <mooedit/mooedit-enums.h>
|
2010-11-23 21:54:39 -08:00
|
|
|
#include <mooedit/mooedittypes.h>
|
2010-12-12 02:29:20 -08:00
|
|
|
#include <mooedit/mooeditfileinfo.h>
|
2005-10-13 14:08:18 +00:00
|
|
|
#include <mooutils/mooprefs.h>
|
2005-06-22 18:20:32 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2010-12-08 01:11:51 -08:00
|
|
|
|
2005-12-11 04:30:02 +00:00
|
|
|
#define MOO_TYPE_EDIT (moo_edit_get_type ())
|
|
|
|
#define MOO_EDIT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), MOO_TYPE_EDIT, MooEdit))
|
|
|
|
#define MOO_EDIT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOO_TYPE_EDIT, MooEditClass))
|
|
|
|
#define MOO_IS_EDIT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), MOO_TYPE_EDIT))
|
|
|
|
#define MOO_IS_EDIT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOO_TYPE_EDIT))
|
|
|
|
#define MOO_EDIT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MOO_TYPE_EDIT, MooEditClass))
|
2005-06-22 18:20:32 +00:00
|
|
|
|
2010-12-12 02:29:20 -08:00
|
|
|
typedef struct MooEditPrivate MooEditPrivate;
|
|
|
|
typedef struct MooEditClass MooEditClass;
|
2005-12-11 04:30:02 +00:00
|
|
|
|
2010-12-12 02:29:20 -08:00
|
|
|
struct MooEdit
|
2005-06-22 18:20:32 +00:00
|
|
|
{
|
2010-12-18 23:58:18 -08:00
|
|
|
GObject parent;
|
2005-12-08 08:53:46 +00:00
|
|
|
MooEditConfig *config;
|
2005-06-22 18:20:32 +00:00
|
|
|
MooEditPrivate *priv;
|
|
|
|
};
|
|
|
|
|
2010-12-12 02:29:20 -08:00
|
|
|
struct MooEditClass
|
2005-06-22 18:20:32 +00:00
|
|
|
{
|
2010-12-18 23:58:18 -08:00
|
|
|
GObjectClass parent_class;
|
2005-06-22 18:20:32 +00:00
|
|
|
|
|
|
|
/* emitted when filename, modified status, or file on disk
|
|
|
|
are changed. for use in editor to adjust title bar, etc. */
|
2005-11-23 11:10:03 +00:00
|
|
|
void (* doc_status_changed) (MooEdit *edit);
|
2005-06-22 18:20:32 +00:00
|
|
|
|
2010-12-19 02:26:03 -08:00
|
|
|
void (* filename_changed) (MooEdit *edit);
|
2005-11-23 11:10:03 +00:00
|
|
|
|
2011-01-21 03:12:18 -08:00
|
|
|
/**signal:MooEdit**/
|
|
|
|
void (* will_close) (MooEdit *doc);
|
|
|
|
|
|
|
|
/**signal:MooEdit**/
|
|
|
|
MooSaveResponse (* before_save) (MooEdit *doc,
|
|
|
|
GFile *file);
|
|
|
|
/**signal:MooEdit**/
|
|
|
|
void (* will_save) (MooEdit *doc,
|
2010-12-19 03:29:16 -08:00
|
|
|
GFile *file);
|
2011-01-21 03:12:18 -08:00
|
|
|
/**signal:MooEdit**/
|
2010-12-19 03:29:16 -08:00
|
|
|
void (* after_save) (MooEdit *doc);
|
2005-06-22 18:20:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-01-17 03:01:11 -08:00
|
|
|
GType moo_edit_get_type (void) G_GNUC_CONST;
|
2005-06-22 18:20:32 +00:00
|
|
|
|
2011-01-17 03:01:11 -08:00
|
|
|
MooEditor *moo_edit_get_editor (MooEdit *doc);
|
|
|
|
MooEditWindow *moo_edit_get_window (MooEdit *doc);
|
2011-01-18 01:16:25 -08:00
|
|
|
MooEditTab *moo_edit_get_tab (MooEdit *doc);
|
2011-01-17 03:01:11 -08:00
|
|
|
MooEditViewArray *moo_edit_get_views (MooEdit *doc);
|
|
|
|
MooEditView *moo_edit_get_view (MooEdit *doc);
|
|
|
|
int moo_edit_get_n_views (MooEdit *doc);
|
2010-11-23 21:54:39 -08:00
|
|
|
|
2011-01-17 03:01:11 -08:00
|
|
|
GtkTextBuffer *moo_edit_get_buffer (MooEdit *doc);
|
2010-11-23 21:54:39 -08:00
|
|
|
|
2011-01-17 03:01:11 -08:00
|
|
|
GFile *moo_edit_get_file (MooEdit *edit);
|
2005-06-22 18:20:32 +00:00
|
|
|
|
2011-01-17 03:01:11 -08:00
|
|
|
char *moo_edit_get_uri (MooEdit *edit);
|
2009-12-13 16:16:39 -08:00
|
|
|
|
2011-01-17 03:01:11 -08:00
|
|
|
char *moo_edit_get_filename (MooEdit *edit);
|
|
|
|
const char *moo_edit_get_display_name (MooEdit *edit);
|
|
|
|
const char *moo_edit_get_display_basename (MooEdit *edit);
|
2010-09-02 18:18:33 -07:00
|
|
|
|
2011-01-17 03:01:11 -08:00
|
|
|
const char *moo_edit_get_encoding (MooEdit *edit);
|
|
|
|
void moo_edit_set_encoding (MooEdit *edit,
|
|
|
|
const char *encoding);
|
|
|
|
|
|
|
|
char *moo_edit_get_lang_id (MooEdit *edit);
|
2010-11-23 21:54:39 -08:00
|
|
|
|
2011-01-17 03:01:11 -08:00
|
|
|
MooLineEndType moo_edit_get_line_end_type (MooEdit *edit);
|
|
|
|
void moo_edit_set_line_end_type (MooEdit *edit,
|
|
|
|
MooLineEndType le);
|
|
|
|
|
|
|
|
gboolean moo_edit_is_empty (MooEdit *edit);
|
|
|
|
gboolean moo_edit_is_untitled (MooEdit *edit);
|
|
|
|
gboolean moo_edit_is_modified (MooEdit *edit);
|
|
|
|
void moo_edit_set_modified (MooEdit *edit,
|
|
|
|
gboolean modified);
|
|
|
|
gboolean moo_edit_get_clean (MooEdit *edit);
|
|
|
|
void moo_edit_set_clean (MooEdit *edit,
|
|
|
|
gboolean clean);
|
|
|
|
MooEditStatus moo_edit_get_status (MooEdit *edit);
|
|
|
|
MooEditState moo_edit_get_state (MooEdit *edit);
|
|
|
|
|
|
|
|
gboolean moo_edit_reload (MooEdit *edit,
|
|
|
|
MooReloadInfo *info,
|
|
|
|
GError **error);
|
|
|
|
gboolean moo_edit_save (MooEdit *edit,
|
|
|
|
GError **error);
|
|
|
|
gboolean moo_edit_save_as (MooEdit *edit,
|
|
|
|
MooSaveInfo *info,
|
|
|
|
GError **error);
|
|
|
|
gboolean moo_edit_save_copy (MooEdit *edit,
|
|
|
|
MooSaveInfo *info,
|
|
|
|
GError **error);
|
2011-01-21 03:12:18 -08:00
|
|
|
gboolean moo_edit_close (MooEdit *edit);
|
2010-12-08 01:11:51 -08:00
|
|
|
|
2011-06-10 19:21:21 -07:00
|
|
|
void moo_edit_comment_selection (MooEdit *edit);
|
|
|
|
void moo_edit_uncomment_selection (MooEdit *edit);
|
2011-05-17 01:53:09 -07:00
|
|
|
|
2005-06-22 18:20:32 +00:00
|
|
|
G_END_DECLS
|