Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

Gnome::Glade::Xml Class Reference

#include <xml.h>

Inheritance diagram for Gnome::Glade::Xml:

Glib::Object Glib::ObjectBase SigC::Object List of all members.

Public Types

typedef Gnome::Glade::XmlError Error

Public Member Functions

virtual ~Xml ()
GladeXML * gobj ()
 Provides access to the underlying C GObject.
const GladeXML * gobj () const
 Provides access to the underlying C GObject.
GladeXML * gobj_copy ()
std::string get_filename () const
Gtk::Widgetget_widget (const Glib::ustring &name)
 Get a widget from the glade file.
template<class T_Widget>
T_Widget * get_widget (const Glib::ustring &name, T_Widget *&widget)
 This is for convenience.
template<class T_Widget>
T_Widget * get_widget_derived (const Glib::ustring &name, T_Widget *&widget)
 This provides a pointer to a widget whose details are specified in the Glade file, but which is implemented by your own derived class.
Glib::ListHandle< Gtk::Widget * > get_widget_prefix (const Glib::ustring &name)
void reparent_widget (const Glib::ustring &name, Gtk::Container &container)
 Take the widget from the glade-generated container and put it in another container.
std::string relative_file (const std::string &filename) const

Static Public Member Functions

static Glib::RefPtr< Xmlcreate (const std::string &filename, const Glib::ustring &root=Glib::ustring(), const Glib::ustring &domain=Glib::ustring())
 Loads a glade XML file.
static Glib::RefPtr< Xmlcreate_from_buffer (const char *buffer, int size, const Glib::ustring &root=Glib::ustring(), const Glib::ustring &domain=Glib::ustring())
 Reads glade XML data from memory.
static Glib::ustring get_widget_name (Gtk::Widget &widget)
static Glib::RefPtr< Xmlget_widget_tree (Gtk::Widget &widget)

Protected Member Functions

 Xml (const std::string &filename, const Glib::ustring &root, const Glib::ustring &domain)
 Loads a glade XML file.
 Xml (const char *buffer, int size, const Glib::ustring &root, const Glib::ustring &domain)
 Reads glade XML data from memory.
Gtk::Widgetget_widget_checked (const Glib::ustring &name, GType type)
GtkWidget * get_cwidget (const Glib::ustring &name)
virtual GType lookup_type_vfunc (const Glib::ustring &classname)
 * interface for changing the custom widget handling */

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gnome::Glade::Xmlwrap (GladeXML *object, bool take_copy=false)

Member Typedef Documentation

typedef Gnome::Glade::XmlError Gnome::Glade::Xml::Error
 


Constructor & Destructor Documentation

virtual Gnome::Glade::Xml::~Xml  )  [virtual]
 

Gnome::Glade::Xml::Xml const std::string &  filename,
const Glib::ustring root,
const Glib::ustring domain
[protected]
 

Loads a glade XML file.

Exceptions:
XmlError 

Gnome::Glade::Xml::Xml const char *  buffer,
int  size,
const Glib::ustring root,
const Glib::ustring domain
[protected]
 

Reads glade XML data from memory.

Exceptions:
XmlError 


Member Function Documentation

static Glib::RefPtr<Xml> Gnome::Glade::Xml::create const std::string &  filename,
const Glib::ustring root = Glib::ustring(),
const Glib::ustring domain = Glib::ustring()
[static]
 

Loads a glade XML file.

Exceptions:
XmlError 

static Glib::RefPtr<Xml> Gnome::Glade::Xml::create_from_buffer const char *  buffer,
int  size,
const Glib::ustring root = Glib::ustring(),
const Glib::ustring domain = Glib::ustring()
[static]
 

Reads glade XML data from memory.

Exceptions:
XmlError 

GtkWidget* Gnome::Glade::Xml::get_cwidget const Glib::ustring name  )  [protected]
 

std::string Gnome::Glade::Xml::get_filename  )  const
 

template<class T_Widget>
T_Widget* Gnome::Glade::Xml::get_widget const Glib::ustring name,
T_Widget *&  widget
[inline]
 

This is for convenience.

It allows for a shorter syntax with less repetition. For instance:

 Gtk::Table* pTable = 0;
 refXml->get_widget("mytable", pTable);
This method prints a warning message to the console if the widget doesn't exist or has the wrong type, so you don't need to check that manually.
Parameters:
name The name of the widget.
Return values:
widget A pointer to the widget, or 0 on failure.
Returns:
The value of widget.

Gtk::Widget* Gnome::Glade::Xml::get_widget const Glib::ustring name  ) 
 

Get a widget from the glade file.

For instance:

 Gtk::Table* pTable = dynamic_cast<Gtk::Table*>(refXml->get_widget("mytable"));
Parameters:
name The name of the widget.
Returns:
A pointer to the widget, or 0 on failure.

Gtk::Widget* Gnome::Glade::Xml::get_widget_checked const Glib::ustring name,
GType  type
[protected]
 

template<class T_Widget>
T_Widget* Gnome::Glade::Xml::get_widget_derived const Glib::ustring name,
T_Widget *&  widget
[inline]
 

This provides a pointer to a widget whose details are specified in the Glade file, but which is implemented by your own derived class.

Your class must have a constructor like so:

 DerivedDialog::DerivedDialog(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade)
 : Gtk::Dialog(cobject) //Calls the base class constructor

For instance:

 Gtk::DerivedBox* pBox = 0;
 refXml->get_widget_derived("mybox", pBox);

Parameters:
name The name of the widget.
Return values:
widget A pointer to the widget, or 0 on failure.
Returns:
The value of widget.

static Glib::ustring Gnome::Glade::Xml::get_widget_name Gtk::Widget widget  )  [static]
 

Glib::ListHandle<Gtk::Widget*> Gnome::Glade::Xml::get_widget_prefix const Glib::ustring name  ) 
 

static Glib::RefPtr<Xml> Gnome::Glade::Xml::get_widget_tree Gtk::Widget widget  )  [static]
 

const GladeXML* Gnome::Glade::Xml::gobj  )  const [inline]
 

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

GladeXML* Gnome::Glade::Xml::gobj  )  [inline]
 

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

GladeXML* Gnome::Glade::Xml::gobj_copy  ) 
 

virtual GType Gnome::Glade::Xml::lookup_type_vfunc const Glib::ustring classname  )  [protected, virtual]
 

* interface for changing the custom widget handling */

std::string Gnome::Glade::Xml::relative_file const std::string &  filename  )  const
 

void Gnome::Glade::Xml::reparent_widget const Glib::ustring name,
Gtk::Container container
 

Take the widget from the glade-generated container and put it in another container.


Friends And Related Function Documentation

Glib::RefPtr< Gnome::Glade::Xml > wrap GladeXML *  object,
bool  take_copy = false
[related]
 


The documentation for this class was generated from the following file:
Generated on Thu May 5 14:28:51 2005 for libglademm by  doxygen 1.4.2