2005-10-13 14:08:18 +00:00
|
|
|
/*
|
2006-08-15 02:32:44 -05:00
|
|
|
* moowindow.h
|
2005-10-13 14:08:18 +00:00
|
|
|
*
|
2010-11-07 01:20:45 -08:00
|
|
|
* Copyright (C) 2004-2010 by Yevgen Muntyan <emuntyan@sourceforge.net>
|
2005-10-13 14:08:18 +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-13 14:08:18 +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-13 14:08:18 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MOOUI_MOOWINDOW_H
|
|
|
|
#define MOOUI_MOOWINDOW_H
|
|
|
|
|
|
|
|
#include <mooutils/mooutils-gobject.h>
|
|
|
|
#include <mooutils/moouixml.h>
|
2006-08-15 02:12:41 -05:00
|
|
|
#include <mooutils/mooactioncollection.h>
|
2008-05-25 03:01:34 -05:00
|
|
|
#include <gtk/gtk.h>
|
2005-10-13 14:08:18 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
|
|
|
#define MOO_TYPE_WINDOW (moo_window_get_type ())
|
|
|
|
#define MOO_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), MOO_TYPE_WINDOW, MooWindow))
|
|
|
|
#define MOO_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOO_TYPE_WINDOW, MooWindowClass))
|
|
|
|
#define MOO_IS_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), MOO_TYPE_WINDOW))
|
|
|
|
#define MOO_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOO_TYPE_WINDOW))
|
|
|
|
#define MOO_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MOO_TYPE_WINDOW, MooWindowClass))
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _MooWindow MooWindow;
|
|
|
|
typedef struct _MooWindowPrivate MooWindowPrivate;
|
|
|
|
typedef struct _MooWindowClass MooWindowClass;
|
|
|
|
|
|
|
|
struct _MooWindow
|
|
|
|
{
|
|
|
|
GtkWindow gtkwindow;
|
|
|
|
|
|
|
|
GtkAccelGroup *accel_group;
|
|
|
|
MooWindowPrivate *priv;
|
|
|
|
|
|
|
|
GtkWidget *menubar;
|
|
|
|
GtkWidget *toolbar;
|
|
|
|
GtkWidget *vbox;
|
2008-05-25 03:01:34 -05:00
|
|
|
GtkWidget *status_area;
|
|
|
|
GtkStatusbar *statusbar;
|
2005-10-13 14:08:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _MooWindowClass
|
|
|
|
{
|
|
|
|
GtkWindowClass parent_class;
|
|
|
|
|
|
|
|
/* signals */
|
2008-05-21 12:17:02 -05:00
|
|
|
gboolean (*close) (MooWindow *window);
|
|
|
|
|
|
|
|
void (*apply_prefs) (MooWindow *window);
|
2005-10-13 14:08:18 +00:00
|
|
|
};
|
|
|
|
|
2006-05-08 23:57:16 -05:00
|
|
|
typedef GtkAction *(*MooWindowActionFunc) (MooWindow *window,
|
2005-10-13 14:08:18 +00:00
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
|
|
|
|
GType moo_window_get_type (void) G_GNUC_CONST;
|
|
|
|
|
2008-05-25 03:01:34 -05:00
|
|
|
gboolean moo_window_close (MooWindow *window);
|
|
|
|
void moo_window_apply_prefs (MooWindow *window);
|
|
|
|
void moo_window_message (MooWindow *window,
|
|
|
|
const char *text);
|
2005-10-13 14:08:18 +00:00
|
|
|
|
2008-05-25 03:01:34 -05:00
|
|
|
void moo_window_set_edit_ops_widget (MooWindow *window,
|
|
|
|
GtkWidget *widget);
|
2005-10-13 14:08:18 +00:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Actions
|
|
|
|
*/
|
|
|
|
|
|
|
|
void moo_window_class_set_id (MooWindowClass *klass,
|
|
|
|
const char *id,
|
|
|
|
const char *name);
|
|
|
|
|
|
|
|
void moo_window_class_new_action (MooWindowClass *klass,
|
|
|
|
const char *id,
|
2006-08-15 02:12:41 -05:00
|
|
|
const char *group,
|
2006-06-20 21:20:58 -05:00
|
|
|
...) G_GNUC_NULL_TERMINATED;
|
2005-10-13 14:08:18 +00:00
|
|
|
void moo_window_class_new_action_custom (MooWindowClass *klass,
|
|
|
|
const char *id,
|
2006-08-15 02:12:41 -05:00
|
|
|
const char *group,
|
2005-10-13 14:08:18 +00:00
|
|
|
MooWindowActionFunc func,
|
2005-11-06 07:33:24 +00:00
|
|
|
gpointer data,
|
|
|
|
GDestroyNotify notify);
|
2007-01-08 20:55:36 -06:00
|
|
|
void _moo_window_class_new_action_callback
|
|
|
|
(MooWindowClass *klass,
|
|
|
|
const char *id,
|
|
|
|
const char *group,
|
|
|
|
GCallback callback,
|
|
|
|
GSignalCMarshaller marshal,
|
|
|
|
GType return_type,
|
|
|
|
guint n_args,
|
|
|
|
...) G_GNUC_NULL_TERMINATED;
|
2005-10-13 14:08:18 +00:00
|
|
|
|
2006-08-16 00:18:16 -05:00
|
|
|
gboolean moo_window_class_find_action (MooWindowClass *klass,
|
|
|
|
const char *id);
|
|
|
|
void moo_window_class_remove_action (MooWindowClass *klass,
|
|
|
|
const char *id);
|
|
|
|
|
2006-08-15 02:12:41 -05:00
|
|
|
void moo_window_class_new_group (MooWindowClass *klass,
|
|
|
|
const char *name,
|
|
|
|
const char *display_name);
|
|
|
|
gboolean moo_window_class_find_group (MooWindowClass *klass,
|
|
|
|
const char *name);
|
|
|
|
void moo_window_class_remove_group (MooWindowClass *klass,
|
|
|
|
const char *name);
|
|
|
|
|
2008-09-13 14:56:47 -05:00
|
|
|
MooUiXml *moo_window_get_ui_xml (MooWindow *window);
|
2005-10-13 14:08:18 +00:00
|
|
|
void moo_window_set_ui_xml (MooWindow *window,
|
2008-09-13 14:56:47 -05:00
|
|
|
MooUiXml *xml);
|
2005-10-13 14:08:18 +00:00
|
|
|
|
2006-08-15 02:12:41 -05:00
|
|
|
MooActionCollection *moo_window_get_actions (MooWindow *window);
|
2006-05-08 23:57:16 -05:00
|
|
|
GtkAction *moo_window_get_action (MooWindow *window,
|
|
|
|
const char *action);
|
2005-10-13 14:08:18 +00:00
|
|
|
|
2007-03-22 23:09:37 -05:00
|
|
|
void moo_window_set_global_accels (MooWindow *window,
|
|
|
|
gboolean global);
|
|
|
|
|
2010-10-07 00:20:47 -07:00
|
|
|
void moo_window_set_default_geometry (const char *geometry);
|
|
|
|
|
2005-10-13 14:08:18 +00:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* MOOUI_MOOWINDOW_H */
|