medit/moo/mooedit/mooeditor.h

166 lines
7.9 KiB
C
Raw Normal View History

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
*
* Copyright (C) 2004-2006 by Yevgen Muntyan <muntyan@math.tamu.edu>
2005-06-22 11:20:32 -07:00
*
* 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.
*
* See COPYING file that comes with this distribution.
*/
2005-09-02 16:27:25 -07:00
#ifndef __MOO_EDITOR_H__
#define __MOO_EDITOR_H__
2005-06-22 11:20:32 -07:00
#include <mooedit/mooeditwindow.h>
#include <mooedit/moolangmgr.h>
#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
{
GObjectClass parent_class;
};
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);
MooEditor *moo_editor_create_instance (void);
2005-06-22 11:20:32 -07:00
/* this creates 'windowless' MooEdit instance */
MooEdit *moo_editor_create_doc (MooEditor *editor,
const char *filename,
const char *encoding,
GError **error);
2005-09-02 16:27:25 -07:00
MooEditWindow *moo_editor_new_window (MooEditor *editor);
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* */
2005-11-02 07:49:35 -08:00
gboolean moo_editor_open_file (MooEditor *editor,
2005-09-02 16:27:25 -07:00
MooEditWindow *window,
GtkWidget *parent,
const char *filename,
const char *encoding);
gboolean moo_editor_new_file (MooEditor *editor,
MooEditWindow *window,
GtkWidget *parent,
const char *filename,
const char *encoding);
gboolean moo_editor_open_uri (MooEditor *editor,
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
2005-11-01 18:32:07 -08:00
void moo_editor_present (MooEditor *editor);
2005-09-02 16:27:25 -07:00
GSList *moo_editor_list_windows (MooEditor *editor);
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,
MooEditWindow *window,
gboolean ask_confirm);
2005-09-02 16:27:25 -07:00
gboolean moo_editor_close_doc (MooEditor *editor,
MooEdit *doc,
gboolean ask_confirm);
2005-09-02 16:27:25 -07:00
gboolean moo_editor_close_docs (MooEditor *editor,
GSList *list,
gboolean ask_confirm);
gboolean moo_editor_close_all (MooEditor *editor,
gboolean ask_confirm);
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);
2005-06-22 11:20:32 -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);
2005-06-22 11:20:32 -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);
MooLangMgr *moo_editor_get_lang_mgr (MooEditor *editor);
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
#ifdef MOOEDIT_COMPILATION
2005-09-02 16:27:25 -07:00
void _moo_edit_window_insert_doc (MooEditWindow *window,
MooEdit *doc,
int position);
void _moo_edit_window_remove_doc (MooEditWindow *window,
2005-07-31 07:53:10 -07:00
MooEdit *doc);
2005-06-22 11:20:32 -07:00
gpointer _moo_editor_get_file_watch (MooEditor *editor);
2005-09-02 16:27:25 -07:00
void _moo_editor_reload (MooEditor *editor,
MooEdit *doc,
GError **error);
2005-09-02 16:27:25 -07:00
gboolean _moo_editor_save (MooEditor *editor,
MooEdit *doc,
GError **error);
2005-09-02 16:27:25 -07:00
gboolean _moo_editor_save_as (MooEditor *editor,
MooEdit *doc,
const char *filename,
const char *encoding,
GError **error);
void _moo_editor_post_message (MooEditor *editor,
GQuark domain,
const char *message);
2005-06-22 11:20:32 -07:00
#endif /* MOOEDIT_COMPILATION */
G_END_DECLS
2005-09-02 16:27:25 -07:00
#endif /* __MOO_EDITOR_H__ */