X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fgnome%2FGnomeBase.h;h=bea178cba1191379a4abc9d88297b9869738044c;hb=f24ed7d6ca1bd04c752f4246a4aaed06ec775d3e;hp=b795b8621e8e5c0a6e51245469bbab9fe05f398e;hpb=c3f9ef4313e5041b896616e70e57ef10a854a862;p=lyx.git diff --git a/src/frontends/gnome/GnomeBase.h b/src/frontends/gnome/GnomeBase.h index b795b8621e..bea178cba1 100644 --- a/src/frontends/gnome/GnomeBase.h +++ b/src/frontends/gnome/GnomeBase.h @@ -17,13 +17,17 @@ #pragma interface #endif +#include "gnome_helpers.h" + +#include +#include + #include "ViewBase.h" #include "gnomeBC.h" -#include -#include "gnome_helpers.h" -namespace Gnome { -class Dialog; + +namespace Gtk { + class Dialog; }; /** @@ -40,10 +44,10 @@ public: protected: /// Get the widget named 'name' from the xml representation. template - T* getWidget(char const * name) const; + T* getWidget(const string & name) const; /// Get the dialog we use. - Gnome::Dialog * dialog(); + Gtk::Dialog * dialog(); /// Show the dialog. void show(); @@ -66,29 +70,27 @@ protected: private: /// Loads the glade file to memory. - void loadXML() const; + void loadXML(); /// The glade file name const string file_; /// The widget name const string widget_name_; /// The XML representation of the dialogs. - mutable GladeXML * xml_; + Glib::RefPtr xml_; /** The dialog we work with, since it is managed by libglade, we do not * need to delete it or destroy it, it will be destroyed with the rest * of the libglade GladeXML structure. */ - Gnome::Dialog * dialog_; + Gtk::Dialog * dialog_; }; template -T* GnomeBase::getWidget(char const * name) const +T* GnomeBase::getWidget(const string & name) const { - if (xml_ == 0) - loadXML(); - return getWidgetPtr(xml_, name); + return dynamic_cast(xml_->get_widget(name)); } /**