medit/moo/mooapp/mooapp.h

110 lines
3.9 KiB
C
Raw Normal View History

2005-06-22 18:20:32 +00:00
/*
2007-06-24 12:56:20 -05:00
* mooapp/mooapp.h
2005-06-22 18:20:32 +00:00
*
2010-11-07 01:20:45 -08:00
* Copyright (C) 2004-2010 by Yevgen Muntyan <emuntyan@sourceforge.net>
2005-06-22 18:20:32 +00: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
*
* 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
*/
#ifndef MOO_APP_H
#define MOO_APP_H
2005-06-22 18:20:32 +00:00
#include <mooedit/mooeditor.h>
2005-06-22 18:20:32 +00:00
G_BEGIN_DECLS
#define MOO_TYPE_APP (moo_app_get_type ())
2005-06-22 18:20:32 +00:00
#define MOO_APP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), MOO_TYPE_APP, MooApp))
#define MOO_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOO_TYPE_APP, MooAppClass))
#define MOO_IS_APP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), MOO_TYPE_APP))
#define MOO_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOO_TYPE_APP))
#define MOO_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MOO_TYPE_APP, MooAppClass))
2010-12-08 01:11:51 -08:00
typedef struct MooApp MooApp;
typedef struct MooAppPrivate MooAppPrivate;
typedef struct MooAppClass MooAppClass;
2005-06-22 18:20:32 +00:00
2010-12-08 01:11:51 -08:00
struct MooApp
2005-06-22 18:20:32 +00:00
{
GObject parent;
MooAppPrivate *priv;
};
2010-12-08 01:11:51 -08:00
struct MooAppClass
2005-06-22 18:20:32 +00:00
{
GObjectClass parent_class;
2007-06-24 12:16:36 -05:00
gboolean (*init) (MooApp *app);
int (*run) (MooApp *app);
void (*quit) (MooApp *app);
2007-06-24 12:16:36 -05:00
gboolean (*try_quit) (MooApp *app);
2005-06-22 18:20:32 +00:00
2007-06-24 12:16:36 -05:00
GtkWidget* (*prefs_dialog) (MooApp *app);
2005-06-22 18:20:32 +00:00
2007-06-24 12:16:36 -05:00
void (*load_session) (MooApp *app,
MooMarkupNode *xml);
void (*save_session) (MooApp *app,
MooMarkupNode *xml);
2008-08-22 22:52:54 -05:00
void (*init_plugins) (MooApp *app);
2005-06-22 18:20:32 +00:00
};
GType moo_app_get_type (void) G_GNUC_CONST;
MooApp *moo_app_get_instance (void);
gboolean moo_app_init (MooApp *app);
2005-06-22 18:20:32 +00:00
int moo_app_run (MooApp *app);
gboolean moo_app_quit (MooApp *app);
2007-06-24 12:16:36 -05:00
void moo_app_load_session (MooApp *app);
2005-06-22 18:20:32 +00:00
MooEditor *moo_app_get_editor (MooApp *app);
2005-06-22 18:20:32 +00:00
void moo_app_prefs_dialog (GtkWidget *parent);
void moo_app_about_dialog (GtkWidget *parent);
char *moo_app_get_system_info (MooApp *app);
2008-09-13 14:56:47 -05:00
MooUiXml *moo_app_get_ui_xml (MooApp *app);
2005-06-22 18:20:32 +00:00
void moo_app_set_ui_xml (MooApp *app,
2008-09-13 14:56:47 -05:00
MooUiXml *xml);
2005-06-22 18:20:32 +00:00
gboolean moo_app_send_msg (const char *pid,
2005-11-02 02:32:07 +00:00
const char *data,
int len);
typedef struct {
char *uri;
char *encoding;
guint line : 24; /* 0 means unset */
guint options : 7;
} MooAppFileInfo;
gboolean moo_app_send_files (MooAppFileInfo *files,
int n_files,
guint32 stamp,
const char *pid);
void moo_app_open_files (MooApp *app,
MooAppFileInfo *files,
int n_files,
guint32 stamp);
2010-10-25 00:05:49 -07:00
void moo_app_run_script (MooApp *app,
const char *script);
2007-07-13 03:42:31 -05:00
2005-06-22 18:20:32 +00:00
G_END_DECLS
#endif /* MOO_APP_H */