2005-09-10 14:41:16 +00:00
|
|
|
/*
|
|
|
|
* mooglade.h
|
|
|
|
*
|
2010-12-21 20:15:45 -08:00
|
|
|
* Copyright (C) 2004-2010 by Yevgen Muntyan <emuntyan@users.sourceforge.net>
|
2005-09-10 14:41:16 +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-09-10 14:41:16 +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-09-10 14:41:16 +00:00
|
|
|
*/
|
|
|
|
|
2007-04-12 10:31:28 -05:00
|
|
|
#ifndef MOO_GLADE_H
|
|
|
|
#define MOO_GLADE_H
|
2005-09-10 14:41:16 +00:00
|
|
|
|
|
|
|
#include <gtk/gtkwidget.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
2006-02-25 23:45:30 -06:00
|
|
|
#define MOO_TYPE_GLADE_XML (moo_glade_xml_get_type ())
|
|
|
|
#define MOO_GLADE_XML(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), MOO_TYPE_GLADE_XML, MooGladeXML))
|
|
|
|
#define MOO_GLADE_XML_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOO_TYPE_GLADE_XML, MooGladeXMLClass))
|
|
|
|
#define MOO_IS_GLADE_XML(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), MOO_TYPE_GLADE_XML))
|
|
|
|
#define MOO_IS_GLADE_XML_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOO_TYPE_GLADE_XML))
|
|
|
|
#define MOO_GLADE_XML_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MOO_TYPE_GLADE_XML, MooGladeXMLClass))
|
|
|
|
|
|
|
|
typedef struct _MooGladeXML MooGladeXML;
|
|
|
|
typedef struct _MooGladeXMLPrivate MooGladeXMLPrivate;
|
|
|
|
typedef struct _MooGladeXMLClass MooGladeXMLClass;
|
|
|
|
|
|
|
|
|
|
|
|
struct _MooGladeXML {
|
|
|
|
GObject base;
|
|
|
|
MooGladeXMLPrivate *priv;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _MooGladeXMLClass {
|
|
|
|
GObjectClass base_class;
|
|
|
|
};
|
|
|
|
|
2005-09-10 14:41:16 +00:00
|
|
|
|
2005-09-11 13:44:14 +00:00
|
|
|
typedef GtkWidget* (*MooGladeCreateFunc) (MooGladeXML *xml,
|
|
|
|
const char *id,
|
|
|
|
gpointer data);
|
|
|
|
typedef gboolean (*MooGladeSignalFunc) (MooGladeXML *xml,
|
|
|
|
const char *widget_id,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const char *signal,
|
|
|
|
const char *handler,
|
|
|
|
const char *object,
|
|
|
|
gpointer data);
|
2006-04-26 17:03:58 -05:00
|
|
|
typedef gboolean (*MooGladePropFunc) (MooGladeXML *xml,
|
|
|
|
const char *widget_id,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const char *property,
|
|
|
|
const char *value,
|
|
|
|
gpointer data);
|
2005-09-11 13:44:14 +00:00
|
|
|
|
|
|
|
|
2006-08-08 19:32:47 -05:00
|
|
|
GType moo_glade_xml_get_type (void) G_GNUC_CONST;
|
2005-09-11 13:44:14 +00:00
|
|
|
|
2006-08-03 02:29:39 -05:00
|
|
|
MooGladeXML *moo_glade_xml_new_empty (const char *domain);
|
2005-09-11 13:44:14 +00:00
|
|
|
|
2008-08-24 01:54:32 -05:00
|
|
|
void moo_glade_xml_register_type (GType type);
|
2005-09-11 13:44:14 +00:00
|
|
|
void moo_glade_xml_map_class (MooGladeXML *xml,
|
|
|
|
const char *class_name,
|
|
|
|
GType use_type);
|
|
|
|
void moo_glade_xml_map_id (MooGladeXML *xml,
|
|
|
|
const char *id,
|
|
|
|
GType use_type);
|
|
|
|
void moo_glade_xml_map_custom (MooGladeXML *xml,
|
|
|
|
const char *id,
|
|
|
|
MooGladeCreateFunc func,
|
|
|
|
gpointer data);
|
2006-04-26 17:03:58 -05:00
|
|
|
void moo_glade_xml_set_signal_func (MooGladeXML *xml,
|
2005-09-11 13:44:14 +00:00
|
|
|
MooGladeSignalFunc func,
|
2007-05-09 12:19:09 -05:00
|
|
|
gpointer data,
|
|
|
|
GDestroyNotify notify);
|
2006-04-26 17:03:58 -05:00
|
|
|
void moo_glade_xml_set_prop_func (MooGladeXML *xml,
|
|
|
|
MooGladePropFunc func,
|
2007-05-09 12:19:09 -05:00
|
|
|
gpointer data,
|
|
|
|
GDestroyNotify notify);
|
2005-09-11 13:44:14 +00:00
|
|
|
|
2006-03-26 18:35:50 -06:00
|
|
|
void moo_glade_xml_set_property (MooGladeXML *xml,
|
|
|
|
const char *widget,
|
|
|
|
const char *prop_name,
|
|
|
|
const char *value);
|
|
|
|
|
2005-09-11 13:44:14 +00:00
|
|
|
gboolean moo_glade_xml_parse_file (MooGladeXML *xml,
|
|
|
|
const char *file,
|
2006-08-08 19:32:47 -05:00
|
|
|
const char *root,
|
|
|
|
GError **error);
|
2005-09-11 13:44:14 +00:00
|
|
|
gboolean moo_glade_xml_parse_memory (MooGladeXML *xml,
|
|
|
|
const char *buffer,
|
|
|
|
int size,
|
2006-08-08 19:32:47 -05:00
|
|
|
const char *root,
|
|
|
|
GError **error);
|
2006-04-04 21:47:42 -05:00
|
|
|
gboolean moo_glade_xml_fill_widget (MooGladeXML *xml,
|
|
|
|
GtkWidget *target,
|
|
|
|
const char *buffer,
|
|
|
|
int size,
|
2006-08-08 19:32:47 -05:00
|
|
|
const char *target_name,
|
|
|
|
GError **error);
|
2005-09-11 13:44:14 +00:00
|
|
|
|
|
|
|
MooGladeXML *moo_glade_xml_new (const char *file,
|
2006-08-03 02:29:39 -05:00
|
|
|
const char *root,
|
2006-08-08 19:32:47 -05:00
|
|
|
const char *domain,
|
|
|
|
GError **error);
|
2005-09-11 13:44:14 +00:00
|
|
|
MooGladeXML *moo_glade_xml_new_from_buf (const char *buffer,
|
|
|
|
int size,
|
2006-08-03 02:29:39 -05:00
|
|
|
const char *root,
|
2006-08-08 19:32:47 -05:00
|
|
|
const char *domain,
|
|
|
|
GError **error);
|
2005-09-11 13:44:14 +00:00
|
|
|
|
|
|
|
gpointer moo_glade_xml_get_widget (MooGladeXML *xml,
|
|
|
|
const char *id);
|
|
|
|
GtkWidget *moo_glade_xml_get_root (MooGladeXML *xml);
|
2005-09-10 14:41:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
2007-04-12 10:31:28 -05:00
|
|
|
#endif /* MOO_GLADE_H */
|