2006-05-21 16:11:05 -07:00
|
|
|
/*
|
2005-09-02 16:27:25 -07:00
|
|
|
* mooeditor.h
|
2005-06-22 11:20:32 -07:00
|
|
|
*
|
2007-04-07 01:21:52 -07:00
|
|
|
* Copyright (C) 2004-2007 by Yevgen Muntyan <muntyan@math.tamu.edu>
|
2005-06-22 11:20:32 -07:00
|
|
|
*
|
2007-06-24 10:56:20 -07:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
2007-09-23 09:47:28 -07:00
|
|
|
* License version 2.1 as published by the Free Software Foundation.
|
2005-06-22 11:20:32 -07:00
|
|
|
*
|
|
|
|
* See COPYING file that comes with this distribution.
|
|
|
|
*/
|
|
|
|
|
2007-06-10 02:06:03 -07:00
|
|
|
#ifndef MOO_EDITOR_H
|
|
|
|
#define MOO_EDITOR_H
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2006-06-19 02:28:32 -07:00
|
|
|
#include <mooedit/mooeditwindow.h>
|
2005-10-16 22:23:40 -07:00
|
|
|
#include <mooedit/moolangmgr.h>
|
2005-10-13 07:08:18 -07:00
|
|
|
#include <mooutils/moouixml.h>
|
|
|
|
#include <mooutils/moohistorylist.h>
|
|
|
|
#include <mooutils/moofiltermgr.h>
|
2005-06-22 11:20:32 -07:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
|
|
|
#define MOO_TYPE_EDITOR (moo_editor_get_type ())
|
|
|
|
#define MOO_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MOO_TYPE_EDITOR, MooEditor))
|
|
|
|
#define MOO_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOO_TYPE_EDITOR, MooEditorClass))
|
|
|
|
#define MOO_IS_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MOO_TYPE_EDITOR))
|
|
|
|
#define MOO_IS_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOO_TYPE_EDITOR))
|
|
|
|
#define MOO_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MOO_TYPE_EDITOR, MooEditorClass))
|
|
|
|
|
|
|
|
typedef struct _MooEditor MooEditor;
|
|
|
|
typedef struct _MooEditorPrivate MooEditorPrivate;
|
|
|
|
typedef struct _MooEditorClass MooEditorClass;
|
|
|
|
|
|
|
|
struct _MooEditor
|
|
|
|
{
|
|
|
|
GObject parent;
|
|
|
|
MooEditorPrivate *priv;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _MooEditorClass
|
|
|
|
{
|
2007-06-24 10:16:36 -07:00
|
|
|
GObjectClass parent_class;
|
|
|
|
|
|
|
|
gboolean (*close_window) (MooEditor *editor,
|
|
|
|
MooEditWindow *window,
|
|
|
|
gboolean ask_confirm);
|
2005-06-22 11:20:32 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-09-02 16:27:25 -07:00
|
|
|
GType moo_editor_get_type (void) G_GNUC_CONST;
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-09-16 10:51:20 -07:00
|
|
|
MooEditor *moo_editor_instance (void);
|
2006-05-29 00:44:45 -07:00
|
|
|
MooEditor *moo_editor_create_instance (void);
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-11-29 01:28:37 -08:00
|
|
|
/* this creates 'windowless' MooEdit instance */
|
2005-12-04 12:13:58 -08:00
|
|
|
MooEdit *moo_editor_create_doc (MooEditor *editor,
|
|
|
|
const char *filename,
|
|
|
|
const char *encoding,
|
|
|
|
GError **error);
|
2005-11-29 01:28:37 -08:00
|
|
|
|
2005-09-02 16:27:25 -07:00
|
|
|
MooEditWindow *moo_editor_new_window (MooEditor *editor);
|
2005-09-02 23:25:43 -07:00
|
|
|
MooEdit *moo_editor_new_doc (MooEditor *editor,
|
|
|
|
MooEditWindow *window);
|
|
|
|
|
2005-11-02 07:49:35 -08:00
|
|
|
gboolean moo_editor_open (MooEditor *editor,
|
2005-09-02 16:27:25 -07:00
|
|
|
MooEditWindow *window,
|
|
|
|
GtkWidget *parent,
|
|
|
|
GSList *files); /* list of MooEditFileInfo* */
|
2006-06-01 00:09:07 -07:00
|
|
|
MooEdit *moo_editor_open_file (MooEditor *editor,
|
2005-09-02 16:27:25 -07:00
|
|
|
MooEditWindow *window,
|
|
|
|
GtkWidget *parent,
|
|
|
|
const char *filename,
|
|
|
|
const char *encoding);
|
2006-06-04 20:13:54 -07:00
|
|
|
MooEdit *moo_editor_open_file_line (MooEditor *editor,
|
|
|
|
const char *filename,
|
2006-07-05 12:32:15 -07:00
|
|
|
int line,
|
|
|
|
MooEditWindow *window);
|
2006-06-01 00:09:07 -07:00
|
|
|
MooEdit *moo_editor_new_file (MooEditor *editor,
|
2006-05-04 00:30:32 -07:00
|
|
|
MooEditWindow *window,
|
|
|
|
GtkWidget *parent,
|
|
|
|
const char *filename,
|
|
|
|
const char *encoding);
|
2006-06-01 00:09:07 -07:00
|
|
|
MooEdit *moo_editor_open_uri (MooEditor *editor,
|
2005-11-28 05:48:36 -08:00
|
|
|
MooEditWindow *window,
|
|
|
|
GtkWidget *parent,
|
|
|
|
const char *uri,
|
|
|
|
const char *encoding);
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-09-08 10:08:31 -07:00
|
|
|
MooEdit *moo_editor_get_doc (MooEditor *editor,
|
|
|
|
const char *filename);
|
|
|
|
|
2005-09-02 16:27:25 -07:00
|
|
|
MooEdit *moo_editor_get_active_doc (MooEditor *editor);
|
|
|
|
MooEditWindow *moo_editor_get_active_window (MooEditor *editor);
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-09-02 16:27:25 -07:00
|
|
|
void moo_editor_set_active_window (MooEditor *editor,
|
|
|
|
MooEditWindow *window);
|
|
|
|
void moo_editor_set_active_doc (MooEditor *editor,
|
|
|
|
MooEdit *doc);
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2006-07-05 12:16:29 -07:00
|
|
|
void moo_editor_present (MooEditor *editor,
|
|
|
|
guint32 stamp);
|
2005-11-01 18:32:07 -08:00
|
|
|
|
2006-06-01 00:09:07 -07:00
|
|
|
/* lists must be freed, content must not be unrefed */
|
2005-09-02 16:27:25 -07:00
|
|
|
GSList *moo_editor_list_windows (MooEditor *editor);
|
2005-12-08 14:46:03 -08:00
|
|
|
GSList *moo_editor_list_docs (MooEditor *editor);
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-09-02 16:27:25 -07:00
|
|
|
gboolean moo_editor_close_window (MooEditor *editor,
|
2005-12-04 12:13:58 -08:00
|
|
|
MooEditWindow *window,
|
|
|
|
gboolean ask_confirm);
|
2005-09-02 16:27:25 -07:00
|
|
|
gboolean moo_editor_close_doc (MooEditor *editor,
|
2005-12-04 12:13:58 -08:00
|
|
|
MooEdit *doc,
|
|
|
|
gboolean ask_confirm);
|
2005-09-02 16:27:25 -07:00
|
|
|
gboolean moo_editor_close_docs (MooEditor *editor,
|
2005-12-04 12:13:58 -08:00
|
|
|
GSList *list,
|
|
|
|
gboolean ask_confirm);
|
|
|
|
gboolean moo_editor_close_all (MooEditor *editor,
|
2007-01-22 06:16:15 -08:00
|
|
|
gboolean ask_confirm,
|
|
|
|
gboolean leave_one);
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-09-02 16:27:25 -07:00
|
|
|
void moo_editor_set_app_name (MooEditor *editor,
|
|
|
|
const char *name);
|
2007-09-05 16:20:01 -07:00
|
|
|
const char *moo_editor_get_app_name (MooEditor *editor);
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-10-13 07:08:18 -07:00
|
|
|
MooHistoryList *moo_editor_get_history (MooEditor *editor);
|
2005-09-02 16:27:25 -07:00
|
|
|
MooFilterMgr *moo_editor_get_filter_mgr (MooEditor *editor);
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-09-02 16:27:25 -07:00
|
|
|
MooUIXML *moo_editor_get_ui_xml (MooEditor *editor);
|
|
|
|
void moo_editor_set_ui_xml (MooEditor *editor,
|
|
|
|
MooUIXML *xml);
|
2006-12-20 16:19:48 -08:00
|
|
|
MooUIXML *moo_editor_get_doc_ui_xml (MooEditor *editor);
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-09-04 11:41:13 -07:00
|
|
|
MooEditor *moo_edit_window_get_editor (MooEditWindow *window);
|
2006-04-07 22:39:13 -07:00
|
|
|
MooEditor *moo_edit_get_editor (MooEdit *doc);
|
2005-09-04 11:41:13 -07:00
|
|
|
|
2005-10-16 22:23:40 -07:00
|
|
|
MooLangMgr *moo_editor_get_lang_mgr (MooEditor *editor);
|
2005-10-13 07:08:18 -07:00
|
|
|
|
2005-11-01 18:32:07 -08:00
|
|
|
void moo_editor_set_window_type (MooEditor *editor,
|
|
|
|
GType type);
|
|
|
|
void moo_editor_set_edit_type (MooEditor *editor,
|
|
|
|
GType type);
|
|
|
|
|
2005-11-01 20:41:09 -08:00
|
|
|
gboolean moo_editor_save_copy (MooEditor *editor,
|
|
|
|
MooEdit *doc,
|
|
|
|
const char *filename,
|
|
|
|
const char *encoding,
|
|
|
|
GError **error);
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2006-12-20 16:19:48 -08:00
|
|
|
void moo_editor_apply_prefs (MooEditor *editor);
|
|
|
|
|
2007-06-24 10:16:36 -07:00
|
|
|
void _moo_editor_load_session (MooEditor *editor,
|
|
|
|
MooMarkupNode *xml);
|
|
|
|
void _moo_editor_save_session (MooEditor *editor,
|
|
|
|
MooMarkupNode *xml);
|
|
|
|
|
2005-06-22 11:20:32 -07:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
2007-06-10 02:06:03 -07:00
|
|
|
#endif /* MOO_EDITOR_H */
|