From f24ed7d6ca1bd04c752f4246a4aaed06ec775d3e Mon Sep 17 00:00:00 2001 From: Michael Gerz Date: Sun, 2 Jun 2002 04:15:33 +0000 Subject: [PATCH] gtkmm-2 upgrade. Still some small bugs to iron out, but mostly functional git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4314 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/gnome/ChangeLog | 30 ++ src/frontends/gnome/Dialogs.C | 33 +- src/frontends/gnome/GERT.C | 16 +- src/frontends/gnome/GError.C | 22 +- src/frontends/gnome/GError.h | 10 +- src/frontends/gnome/GPreamble.C | 26 +- src/frontends/gnome/GPreamble.h | 4 +- src/frontends/gnome/GTabularCreate.C | 10 +- src/frontends/gnome/GTabularCreate.h | 3 +- src/frontends/gnome/GUIRunTime.C | 33 +- src/frontends/gnome/GUrl.C | 19 +- src/frontends/gnome/GnomeBase.C | 20 +- src/frontends/gnome/GnomeBase.h | 28 +- src/frontends/gnome/Makefile.am | 29 +- src/frontends/gnome/Timeout_pimpl.C | 10 +- src/frontends/gnome/Timeout_pimpl.h | 4 +- src/frontends/gnome/dialogs/GERT.glade | 282 +++++------ src/frontends/gnome/dialogs/GError.glade | 164 +++---- src/frontends/gnome/dialogs/GPreamble.glade | 192 ++++---- .../gnome/dialogs/GTabularCreate.glade | 373 +++++++------- src/frontends/gnome/dialogs/GUrl.glade | 461 ++++++++---------- src/frontends/gnome/gnomeBC.C | 5 +- src/frontends/gnome/gnome_helpers.C | 203 -------- src/frontends/gnome/gnome_helpers.h | 37 +- 24 files changed, 868 insertions(+), 1146 deletions(-) diff --git a/src/frontends/gnome/ChangeLog b/src/frontends/gnome/ChangeLog index ffd4e43983..ed353cd0e5 100644 --- a/src/frontends/gnome/ChangeLog +++ b/src/frontends/gnome/ChangeLog @@ -1,3 +1,33 @@ +2002-06-02 Michael A. Koziarski + + == Gtkmm2 upgrade == + + * dialogs/*: Updated to glade-2 format. + * Dialogs.C: add() calls updated + * GError.C + * GError.h + * GERT.C + * GERT.h + * GPreamble.C + * GPreamble.h + * GTabularCreate.C + * GTabularCreate.h + * GUIRunTime.C + * GUrl.C + * GUrl.h: updated for gtkmm2 + * GnomeBase.C + * GnomeBase.h: updated for gtkmm2 and libglademm. + * gnome_helpers.C + * gnome_helpers.h: Cruft removed. Blasted X.h #defines #undef'd + * Timeout_pimpl.C + * Timeout_pimpl.h + * GUIRuntime.C: fix up the references to Gnome::* to use Gtk::*, + slight other changes required + * Makefile.am: all neccessary changes, mostly including stuff + that's been moved into src/frontends/xforms + + + 2002-05-23 John Levon * FileDialog.C: LyXView moved into frontends/ diff --git a/src/frontends/gnome/Dialogs.C b/src/frontends/gnome/Dialogs.C index 94e9627886..9874ad9c68 100644 --- a/src/frontends/gnome/Dialogs.C +++ b/src/frontends/gnome/Dialogs.C @@ -14,19 +14,22 @@ #pragma implementation #endif -#include "gettext.h" #include "Dialogs.h" -#include "frontends/LyXView.h" -#include "gnomeBC.h" -#include "Tooltips.h" + #include "GUI.h" +#include "gnomeBC.h" + +#include "frontends/LyXView.h" -#include "GUrl.h" #include "GError.h" -#include "GTabularCreate.h" #include "GERT.h" #include "GPreamble.h" +#include "GTabularCreate.h" +#include "GUrl.h" + + +#include "Tooltips.h" bool Dialogs::tooltipsEnabled() { @@ -34,15 +37,21 @@ bool Dialogs::tooltipsEnabled() } Dialogs::Dialogs(LyXView * lv) { - add(new GUIUrl(*lv, *this)); - add(new GUIError(*lv, *this)); - add(new GUITabularCreate(*lv, *this)); - add(new GUIERT(*lv, *this)); - add(new GUIPreamble(*lv, *this)); + + add(new GUI(*lv, *this)); + add(new GUI(*lv, *this)); + add(new GUI(*lv,*this)); + add(new GUI(*lv, *this)); + add(new GUI(*lv, *this)); // reduce the number of connections needed in // dialogs by a simple connection here. - hideAll.connect(hideBufferDependent.slot()); + hideAll.connect(hideBufferDependent); } /***************************************************************************** diff --git a/src/frontends/gnome/GERT.C b/src/frontends/gnome/GERT.C index e567f08f7b..1b4b2f17ac 100644 --- a/src/frontends/gnome/GERT.C +++ b/src/frontends/gnome/GERT.C @@ -18,8 +18,8 @@ #include "gnomeBC.h" #include "GERT.h" -#include -#include +#include +#include GERT::GERT(ControlERT & c) : FormCB(c, "GERT") @@ -33,9 +33,9 @@ GERT::~GERT() void GERT::build() { // Connect the buttons. - ok_btn()->clicked.connect(SigC::slot(this, &GERT::OKClicked)); - cancel_btn()->clicked.connect(SigC::slot(this, &GERT::CancelClicked)); - apply_btn()->clicked.connect(SigC::slot(this, &GERT::ApplyClicked)); + ok_btn()->signal_clicked().connect(SigC::slot(*this, &GERT::OKClicked)); + cancel_btn()->signal_clicked().connect(SigC::slot(*this, &GERT::CancelClicked)); + apply_btn()->signal_clicked().connect(SigC::slot(*this, &GERT::ApplyClicked)); // Manage the buttons state bc().setOK(ok_btn()); @@ -55,9 +55,9 @@ void GERT::build() void GERT::connect_signals() { - slot_open = open()->clicked.connect(SigC::slot(this, &GERT::InputChanged)); - slot_collapsed = collapsed()->clicked.connect(SigC::slot(this, &GERT::InputChanged)); - slot_inlined = inlined()->clicked.connect(SigC::slot(this, &GERT::InputChanged)); + slot_open = open()->signal_clicked().connect(SigC::slot(*this, &GERT::InputChanged)); + slot_collapsed = collapsed()->signal_clicked().connect(SigC::slot(*this, &GERT::InputChanged)); + slot_inlined = inlined()->signal_clicked().connect(SigC::slot(*this, &GERT::InputChanged)); } diff --git a/src/frontends/gnome/GError.C b/src/frontends/gnome/GError.C index be3c198ca0..52614d579f 100644 --- a/src/frontends/gnome/GError.C +++ b/src/frontends/gnome/GError.C @@ -19,18 +19,20 @@ #include "gnomeBC.h" #include "GError.h" -#include -#include +#include +#include -GError::GError(ControlError & c) +GErrorDialog::GErrorDialog(ControlError & c) : FormCB(c, "GError") {} -void GError::build() +void GErrorDialog::build() { // Connect the buttons. - button_close()->clicked.connect(SigC::slot(this, &GError::CloseClicked)); + button_close()->signal_clicked().connect( + SigC::slot(*this, &GErrorDialog::CloseClicked) + ); // Manage the buttons state bc().setCancel(button_close()); @@ -40,17 +42,17 @@ void GError::build() } -void GError::update() +void GErrorDialog::update() { - textarea()->insert(controller().params()); + textarea()->get_buffer()->set_text(controller().params()); } -Gtk::Button * GError::button_close() const +Gtk::Button * GErrorDialog::button_close() const { return getWidget("r_button_close"); } -Gtk::Text * GError::textarea() const +Gtk::TextView * GErrorDialog::textarea() const { - return getWidget("r_textarea"); + return getWidget("r_textarea"); } diff --git a/src/frontends/gnome/GError.h b/src/frontends/gnome/GError.h index 383707b88b..3c8e0a8783 100644 --- a/src/frontends/gnome/GError.h +++ b/src/frontends/gnome/GError.h @@ -25,19 +25,19 @@ namespace Gtk { class Button; -class Text; +class TextView; } /** * This class implements the dialog to show error messages. */ -class GError : public FormCB { +class GErrorDialog : public FormCB { public: /// - GError(ControlError & c); + GErrorDialog(ControlError & c); /// - ~GError() {} + ~GErrorDialog() {} /// void apply() {} /// @@ -56,7 +56,7 @@ private: /// generated by accessors.py Gtk::Button * button_close() const; /// generated by accessors.py - Gtk::Text * textarea() const; + Gtk::TextView * textarea() const; }; #endif diff --git a/src/frontends/gnome/GPreamble.C b/src/frontends/gnome/GPreamble.C index a8cc4d5b21..5737be48e6 100644 --- a/src/frontends/gnome/GPreamble.C +++ b/src/frontends/gnome/GPreamble.C @@ -18,8 +18,8 @@ #include "gnomeBC.h" #include "GPreamble.h" -#include -#include +#include +#include GPreamble::GPreamble(ControlPreamble & c) : FormCB(c, "GPreamble") @@ -33,9 +33,9 @@ GPreamble::~GPreamble() void GPreamble::build() { // Connect the buttons. - ok_btn()->clicked.connect(SigC::slot(this, &GPreamble::OKClicked)); - cancel_btn()->clicked.connect(SigC::slot(this, &GPreamble::CancelClicked)); - apply_btn()->clicked.connect(SigC::slot(this, &GPreamble::ApplyClicked)); + ok_btn()->signal_clicked().connect(SigC::slot(*this, &GPreamble::OKClicked)); + cancel_btn()->signal_clicked().connect(SigC::slot(*this, &GPreamble::CancelClicked)); + apply_btn()->signal_clicked().connect(SigC::slot(*this, &GPreamble::ApplyClicked)); // Manage the buttons state bc().setOK(ok_btn()); bc().setCancel(cancel_btn()); @@ -45,22 +45,24 @@ void GPreamble::build() void GPreamble::apply() { - controller().params() = preamble()->get_chars(0,-1); + controller().params() = preamble()->get_buffer()->get_text(preamble()->get_buffer()->get_start_iter(), + preamble()->get_buffer()->get_end_iter(), + false); } void GPreamble::update() { disconnect_signals(); - preamble()->set_point(0); - preamble()->forward_delete(preamble()->get_length()); - preamble()->insert(controller().params()); + preamble()->get_buffer()->set_text(controller().params()); connect_signals(); } void GPreamble::connect_signals() { - slot_preamble_ = preamble()->changed.connect(SigC::slot(this, &GPreamble::InputChanged)); + slot_preamble_ = preamble()-> + get_buffer()-> + signal_changed().connect(SigC::slot(*this, &GPreamble::InputChanged)); } void GPreamble::disconnect_signals() @@ -80,7 +82,7 @@ Gtk::Button * GPreamble::cancel_btn() const { return getWidget("r_cancel_btn"); } -Gtk::Text * GPreamble::preamble() const +Gtk::TextView * GPreamble::preamble() const { - return getWidget("r_preamble"); + return getWidget("r_preamble"); } diff --git a/src/frontends/gnome/GPreamble.h b/src/frontends/gnome/GPreamble.h index 07afaaaf92..27a757f596 100644 --- a/src/frontends/gnome/GPreamble.h +++ b/src/frontends/gnome/GPreamble.h @@ -23,7 +23,7 @@ namespace Gtk { class Button; -class Text; +class TextView; } /** @@ -58,7 +58,7 @@ private: /// generated by accessors.py Gtk::Button * cancel_btn() const; /// generated by accessors.py - Gtk::Text * preamble() const; + Gtk::TextView * preamble() const; /// SigC::Connection slot_preamble_; diff --git a/src/frontends/gnome/GTabularCreate.C b/src/frontends/gnome/GTabularCreate.C index 71f6b0a38a..714bc68968 100644 --- a/src/frontends/gnome/GTabularCreate.C +++ b/src/frontends/gnome/GTabularCreate.C @@ -19,8 +19,8 @@ #include "gnomeBC.h" #include "GTabularCreate.h" -#include -#include +#include +#include GTabularCreate::GTabularCreate(ControlTabularCreate & c) : FormCB(c, "GTabularCreate") @@ -34,11 +34,11 @@ GTabularCreate::~GTabularCreate() void GTabularCreate::build() { // Connect the buttons. - ok_btn()->clicked.connect(SigC::slot(this, + ok_btn()->signal_clicked().connect(SigC::slot(*this, >abularCreate::OKClicked)); - cancel_btn()->clicked.connect(SigC::slot(this, + cancel_btn()->signal_clicked().connect(SigC::slot(*this, >abularCreate::CancelClicked)); - apply_btn()->clicked.connect(SigC::slot(this, + apply_btn()->signal_clicked().connect(SigC::slot(*this, >abularCreate::ApplyClicked)); // Manage the buttons state diff --git a/src/frontends/gnome/GTabularCreate.h b/src/frontends/gnome/GTabularCreate.h index 314ca03828..9cae480a73 100644 --- a/src/frontends/gnome/GTabularCreate.h +++ b/src/frontends/gnome/GTabularCreate.h @@ -22,7 +22,8 @@ #include "GnomeBase.h" namespace Gtk { -class SpinButton; + class SpinButton; + class Button; } /** diff --git a/src/frontends/gnome/GUIRunTime.C b/src/frontends/gnome/GUIRunTime.C index ccd1d48d8d..7a5133e01d 100644 --- a/src/frontends/gnome/GUIRunTime.C +++ b/src/frontends/gnome/GUIRunTime.C @@ -14,12 +14,14 @@ #endif #include FORMS_H_LOCATION - +#include "gnome_helpers.h" #include "GUIRunTime.h" #include "debug.h" -#include -#include +#include +#include + +#include // For now we use the xforms image loader if we can. // In the future, this will be replaced by a gnome equivalent. @@ -31,13 +33,6 @@ using std::endl; -// I keep these here so that it will be processed as early in -// the compilation process as possible. -#if !defined(FL_REVISION) || FL_REVISION < 88 || FL_VERSION != 0 -#error LyX will not compile with this version of XForms.\ - Please get version 0.89.\ - If you want to try to compile anyway, delete this test in src/frontends/gnome/GUIRunTime.C. -#endif extern bool finished; @@ -48,7 +43,7 @@ int const xforms_include_version = FL_INCLUDE_VERSION; } // namespace anon -int GUIRunTime::initApplication(int &, char * argv[]) +int GUIRunTime::initApplication(int & argc , char * argv[]) { // Check the XForms version in the forms.h header against // the one in the libforms. If they don't match quit the @@ -79,16 +74,15 @@ int GUIRunTime::initApplication(int &, char * argv[]) // lyx_gui, the same place as xforms does the same. (Lgb) string app_id(PACKAGE); string app_version(VERSION); - static Gnome::Main a(app_id, app_version, 1, argv); - glade_gnome_init(); // Initialize the glade library. + new Gtk::Main (argc, argv); return 0; } void GUIRunTime::processEvents() { - while (Gnome::Main::instance()->events_pending()) - Gnome::Main::instance()->iteration(FALSE); + while (Gtk::Main::events_pending()) + Gtk::Main::iteration(false); } @@ -141,16 +135,15 @@ LyXView * GUIRunTime::createMainView(int w, int h) void GUIRunTime::initialiseGraphics() { using namespace grfx; - using SigC::slot; #if defined(HAVE_FLIMAGE_DUP) && defined(HAVE_FLIMAGE_TO_PIXMAP) // connect the image loader based on the xforms library - GImage::newImage.connect(slot(&xformsGImage::newImage)); - GImage::loadableFormats.connect(slot(&xformsGImage::loadableFormats)); + GImage::newImage.connect(boost::bind(&xformsGImage::newImage)); + GImage::loadableFormats.connect(boost::bind(&xformsGImage::loadableFormats)); #else // connect the image loader based on the XPM library - GImage::newImage.connect(slot(&GImageXPM::newImage)); - GImage::loadableFormats.connect(slot(&GImageXPM::loadableFormats)); + GImage::newImage.connect(boost::bind(&GImageXPM::newImage)); + GImage::loadableFormats.connect(boost::bind(&GImageXPM::loadableFormats)); #endif } diff --git a/src/frontends/gnome/GUrl.C b/src/frontends/gnome/GUrl.C index 6657924039..cd918d3c4f 100644 --- a/src/frontends/gnome/GUrl.C +++ b/src/frontends/gnome/GUrl.C @@ -19,8 +19,9 @@ #include "gnomeBC.h" #include "GUrl.h" -#include -#include +#include +#include +#include GUrl::GUrl(ControlUrl & c) : FormCB(c, "GUrl") @@ -34,10 +35,10 @@ GUrl::~GUrl() void GUrl::build() { // Connect the buttons. - ok_btn()->clicked.connect(SigC::slot(this, &GUrl::OKClicked)); - cancel_btn()->clicked.connect(SigC::slot(this, &GUrl::CancelClicked)); - apply_btn()->clicked.connect(SigC::slot(this, &GUrl::ApplyClicked)); - restore_btn()->clicked.connect(SigC::slot(this, &GUrl::RestoreClicked)); + ok_btn()->signal_clicked().connect(SigC::slot(*this, &GUrl::OKClicked)); + cancel_btn()->signal_clicked().connect(SigC::slot(*this, &GUrl::CancelClicked)); + apply_btn()->signal_clicked().connect(SigC::slot(*this, &GUrl::ApplyClicked)); + restore_btn()->signal_clicked().connect(SigC::slot(*this, &GUrl::RestoreClicked)); // Manage the buttons state bc().setOK(ok_btn()); @@ -58,9 +59,9 @@ void GUrl::build() void GUrl::connect_signals() { // Get notifications on input change - slot_url_ = url()->changed.connect(SigC::slot(this, &GUrl::InputChanged)); - slot_name_ = name()->changed.connect(SigC::slot(this, &GUrl::InputChanged)); - slot_html_ = html_cb()->toggled.connect(SigC::slot(this, &GUrl::InputChanged)); + slot_url_ = url()->signal_changed().connect(SigC::slot(*this, &GUrl::InputChanged)); + slot_name_ = name()->signal_changed().connect(SigC::slot(*this, &GUrl::InputChanged)); + slot_html_ = html_cb()->signal_toggled().connect(SigC::slot(*this, &GUrl::InputChanged)); } diff --git a/src/frontends/gnome/GnomeBase.C b/src/frontends/gnome/GnomeBase.C index e7d00f8585..a220f82594 100644 --- a/src/frontends/gnome/GnomeBase.C +++ b/src/frontends/gnome/GnomeBase.C @@ -17,24 +17,22 @@ #include "debug.h" #include "support/filetools.h" #include - -#include +#include GnomeBase::GnomeBase(ControlButtons & c, string const & name) : ViewBC(c) , file_(name + ".glade"), widget_name_(name), xml_(0) , dialog_(0) -{} - -GnomeBase::~GnomeBase() { - if (xml_) - gtk_object_unref(GTK_OBJECT(xml_)); + loadXML(); } +GnomeBase::~GnomeBase() +{} + -void GnomeBase::loadXML() const +void GnomeBase::loadXML() { #ifdef WITH_WARNINGS #warning Change this before declaring it production code! (be 20010325) @@ -49,7 +47,7 @@ void GnomeBase::loadXML() const lyxerr[Debug::GUI] << "Glade file to open is " << file << '\n'; - xml_ = glade_xml_new(file.c_str(), widget_name_.c_str()); + xml_ = Gnome::Glade::Xml::create (file, widget_name_); } @@ -99,10 +97,10 @@ void GnomeBase::InputChanged() bc().valid(validate()); } -Gnome::Dialog * GnomeBase::dialog() +Gtk::Dialog * GnomeBase::dialog() { if (!dialog_) - dialog_ = getWidget(widget_name_.c_str()); + dialog_ = getWidget(widget_name_); return dialog_; } 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)); } /** diff --git a/src/frontends/gnome/Makefile.am b/src/frontends/gnome/Makefile.am index 51fda583af..5cb06a0809 100644 --- a/src/frontends/gnome/Makefile.am +++ b/src/frontends/gnome/Makefile.am @@ -6,7 +6,7 @@ INCLUDES = $(FRONTEND_INCLUDES) -I$(top_srcdir)/src/ \ -I$(top_srcdir)/src/frontends/ \ -I$(top_srcdir)/src/frontends/xforms \ -I$(top_srcdir)/src/frontends/controllers \ - $(SIGC_CFLAGS) $(BOOST_INCLUDES) + $(BOOST_INCLUDES) if USE_BASIC_IMAGE_LOADER else @@ -19,9 +19,14 @@ xforms_objects = \ ../xforms/bmtable.lo \ ../xforms/combox.lo \ ../xforms/Color.lo \ + ../xforms/ColorHandler.lo \ ../xforms/DropDown.lo \ ../xforms/FeedbackController.lo \ + ../xforms/FileDialog.lo \ + ../xforms/FontInfo.lo \ ../xforms/FormBaseDeprecated.lo \ + ../xforms/FormFiledialog.lo \ + ../xforms/form_filedialog.lo \ ../xforms/FormMathsBitmap.lo \ ../xforms/FormMathsDeco.lo \ ../xforms/form_maths_deco.lo \ @@ -35,12 +40,19 @@ xforms_objects = \ ../xforms/form_maths_space.lo \ ../xforms/FormMathsStyle.lo \ ../xforms/form_maths_style.lo \ + ../xforms/lyxlookup.lo \ ../xforms/MathsSymbols.lo \ ../xforms/Menubar_pimpl.lo \ ../xforms/Toolbar_pimpl.lo \ ../xforms/Tooltips.lo \ + ../xforms/xfont_loader.lo \ + ../xforms/xfont_metrics.lo \ ../xforms/xforms_helpers.lo \ - ../xforms/xformsBC.lo $(XFORMSGIMAGE) + ../xforms/xforms_resize.lo \ + ../xforms/xformsBC.lo \ + ../xforms/XFormsView.lo \ + ../xforms/XPainter.lo \ + ../xforms/XWorkArea.lo $(XFORMSGIMAGE) libgnome.la: xforms.lo $(libgnome_la_OBJECTS) $(libgnome_la_DEPENDENCIES) @@ -56,17 +68,16 @@ xforms.lo: $(xforms_objects) libgnome_la_SOURCES = \ Dialogs.C \ - FileDialog.C \ GError.C \ GError.h \ - GTabularCreate.C \ - GTabularCreate.h \ - GUrl.C \ - GUrl.h \ GERT.C \ GERT.h \ GPreamble.C \ GPreamble.h \ + GTabularCreate.C \ + GTabularCreate.h \ + GUrl.C \ + GUrl.h \ gnome_helpers.C \ gnome_helpers.h \ GnomeBase.C \ @@ -75,11 +86,11 @@ libgnome_la_SOURCES = \ gnomeBC.h \ GUIRunTime.C \ pixbutton.h \ - support.c \ - support.h \ Timeout_pimpl.C \ Timeout_pimpl.h + + # Trying to make things a litte more tidy. -- Koz-2002-01-11 # mainapp.C \ # mainapp.h \ diff --git a/src/frontends/gnome/Timeout_pimpl.C b/src/frontends/gnome/Timeout_pimpl.C index c397a628c9..f5213854e1 100644 --- a/src/frontends/gnome/Timeout_pimpl.C +++ b/src/frontends/gnome/Timeout_pimpl.C @@ -13,7 +13,7 @@ #pragma implementation #endif -#include +#include #include "Timeout_pimpl.h" #include "debug.h" @@ -41,8 +41,8 @@ void Timeout::Pimpl::start() stop(); } - conn_ = Gnome::Main::timeout.connect( - SigC::slot(this, &Timeout::Pimpl::timeoutEvent), + conn_ = Gtk::Main::signal_timeout().connect( + SigC::slot(*this, &Timeout::Pimpl::timeoutEvent), owner_->timeout_ms ); running_ = true; @@ -56,8 +56,8 @@ void Timeout::Pimpl::stop() } -gint Timeout::Pimpl::timeoutEvent() +bool Timeout::Pimpl::timeoutEvent() { owner_->emit(); - return 0; // discontinue emitting timeouts. + return false; // discontinue emitting timeouts. } diff --git a/src/frontends/gnome/Timeout_pimpl.h b/src/frontends/gnome/Timeout_pimpl.h index 1979041a7e..ea18891725 100644 --- a/src/frontends/gnome/Timeout_pimpl.h +++ b/src/frontends/gnome/Timeout_pimpl.h @@ -12,7 +12,7 @@ #include "frontends/Timeout.h" #include "glib.h" // for gint -#include +#include #ifdef __GNUG__ #pragma interface @@ -38,7 +38,7 @@ public: public: /// The timeout signal, this gets called when the timeout passed. - gint timeoutEvent(); + bool timeoutEvent(); private: /// the owning timer Timeout * owner_; diff --git a/src/frontends/gnome/dialogs/GERT.glade b/src/frontends/gnome/dialogs/GERT.glade index 20ec00a85d..a52c7e04e4 100644 --- a/src/frontends/gnome/dialogs/GERT.glade +++ b/src/frontends/gnome/dialogs/GERT.glade @@ -1,160 +1,148 @@ - - + + - - diainserturl - diainserturl - - - pixmaps - C - True - True - True - False - False - True - diainserturl_interface.c - diainserturl_interface.h - diainserturl_callbacks.c - diainserturl_callbacks.h - + + + 2 + no + ERT Options + GTK_WINDOW_DIALOG + no + yes + yes + GTK_WIN_POS_NONE - - GnomeDialog - GERT - 2 - False - ERT Options - GTK_WINDOW_DIALOG - GTK_WIN_POS_NONE - False - True - True - False - False - True + + + no + 8 + yes - - GtkVBox - GnomeDialog:vbox - dialog-vbox1 - False - 8 - - 4 - True - True - + + + GTK_BUTTONBOX_DEFAULT_STYLE + 8 + yes - - GtkHButtonBox - GnomeDialog:action_area - dialog-action_area1 - GTK_BUTTONBOX_DEFAULT_STYLE - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - + + + yes + yes + yes + gtk-ok + yes + yes + + - - GtkButton - r_ok_btn - True - True - GNOME_STOCK_BUTTON_OK - + + + yes + yes + yes + gtk-apply + yes + yes + + - - GtkButton - r_apply_btn - True - True - GNOME_STOCK_BUTTON_APPLY - + + + yes + yes + yes + yes + gtk-cancel + yes + yes + + + + + 0 + no + yes + GTK_PACK_END + + - - GtkButton - r_cancel_btn - True - True - True - GNOME_STOCK_BUTTON_CANCEL - - + + + Status + 0 + GTK_SHADOW_ETCHED_IN + yes - - GtkFrame - frame1 - - 0 - GTK_SHADOW_ETCHED_IN - - 0 - True - True - + + + no + 0 + yes - - GtkVBox - vbox1 - False - 0 + + + yes + _Open + yes + yes + yes + yes + + + 0 + no + no + + - - GtkRadioButton - r_open - True - - True - True - status - - 0 - False - False - - + + + yes + _Collapsed + no + yes + yes + r_open + yes + + + 0 + no + no + + - - GtkRadioButton - r_collapsed - True - - False - True - status - - 0 - False - False - - - - - GtkRadioButton - r_inlined - True - - False - True - status - - 0 - False - False - - + + + yes + _Inlined View + no + yes + yes + r_open + yes + + + 0 + no + no + + + + + + + 0 + yes + yes + + - + + 4 + yes + yes + + - - - + diff --git a/src/frontends/gnome/dialogs/GError.glade b/src/frontends/gnome/dialogs/GError.glade index 6391732cf9..2d7fcafb34 100644 --- a/src/frontends/gnome/dialogs/GError.glade +++ b/src/frontends/gnome/dialogs/GError.glade @@ -1,100 +1,86 @@ - - + + - - diainserturl - diainserturl - - - pixmaps - C - True - True - True - False - False - True - diainserturl_interface.c - diainserturl_interface.h - diainserturl_callbacks.c - diainserturl_callbacks.h - + - - GnomeDialog - GError - Error - GTK_WINDOW_DIALOG - GTK_WIN_POS_NONE - False - True - True - True - False - True + + Error + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True - - GtkVBox - GnomeDialog:vbox - dialog-vbox1 - False - 8 - - 4 - True - True - + + + 2 + True + False + 8 - - GtkHButtonBox - GnomeDialog:action_area - dialog-action_area1 - GTK_BUTTONBOX_END - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - + + + 5 + True + GTK_BUTTONBOX_END + 10 - - GtkButton - r_button_close - True - True - GNOME_STOCK_BUTTON_CLOSE - - + + + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + 0 + + + + + 0 + False + True + GTK_PACK_END + + - - GtkScrolledWindow - scrolledwindow1 - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_UPDATE_CONTINUOUS - GTK_UPDATE_CONTINUOUS - 0 - True - True - + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT - - GtkText - r_textarea - 250 - 200 - True - False - - + + + True + True + True + GTK_JUSTIFY_LEFT + GTK_WRAP_NONE + True + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + 0 + True + True + + - + - + diff --git a/src/frontends/gnome/dialogs/GPreamble.glade b/src/frontends/gnome/dialogs/GPreamble.glade index 06393ab05f..da8b545616 100644 --- a/src/frontends/gnome/dialogs/GPreamble.glade +++ b/src/frontends/gnome/dialogs/GPreamble.glade @@ -1,108 +1,110 @@ - - + + - - Project1 - project1 - - src - pixmaps - C - True - True - + - - GnomeDialog - GPreamble - LaTeX Preamble - GTK_WINDOW_DIALOG - GTK_WIN_POS_NONE - False - True - True - True - False - False + + LaTeX Preamble + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True - - GtkVBox - GnomeDialog:vbox - dialog-vbox1 - False - 8 - - 4 - True - True - + + + 2 + True + False + 8 - - GtkHButtonBox - GnomeDialog:action_area - dialog-action_area1 - GTK_BUTTONBOX_END - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - + + + 5 + True + GTK_BUTTONBOX_END + 10 - - GtkButton - r_ok_btn - True - True - GNOME_STOCK_BUTTON_OK - + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + 0 + + - - GtkButton - r_apply_btn - True - True - GNOME_STOCK_BUTTON_APPLY - + + + True + True + True + gtk-apply + True + GTK_RELIEF_NORMAL + 0 + + - - GtkButton - r_cancel_btn - True - True - GNOME_STOCK_BUTTON_CLOSE - - + + + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + 0 + + + + + 0 + False + True + GTK_PACK_END + + - - GtkScrolledWindow - scrolledwindow1 - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_UPDATE_CONTINUOUS - GTK_UPDATE_CONTINUOUS - 0 - True - True - + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT - - GtkText - r_preamble - 166 - 146 - True - True - - + + + True + True + True + GTK_JUSTIFY_LEFT + GTK_WRAP_NONE + True + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + 0 + True + True + + - + - + diff --git a/src/frontends/gnome/dialogs/GTabularCreate.glade b/src/frontends/gnome/dialogs/GTabularCreate.glade index 387c00f87b..96420f283c 100644 --- a/src/frontends/gnome/dialogs/GTabularCreate.glade +++ b/src/frontends/gnome/dialogs/GTabularCreate.glade @@ -1,215 +1,184 @@ - - + + - - DiaInsertTabular - diainserttabular - - src - pixmaps - C - True - True - + + + Insert Tabular + GTK_WINDOW_DIALOG + no + no + no + no + GTK_WIN_POS_NONE - - GnomeDialog - GTabularCreate - Insert Tabular - GTK_WINDOW_DIALOG - GTK_WIN_POS_NONE - False - False - False - False - False - True + + + no + 8 + yes - - GtkVBox - GnomeDialog:vbox - dialog-vbox1 - False - 8 - - 4 - True - True - + + + GTK_BUTTONBOX_END + 8 + yes - - GtkHButtonBox - GnomeDialog:action_area - dialog-action_area1 - GTK_BUTTONBOX_END - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - + + + yes + yes + yes + gtk-ok + yes + yes + + - - GtkButton - r_ok_btn - True - True - GNOME_STOCK_BUTTON_OK - + + + yes + yes + yes + gtk-apply + yes + yes + + - - GtkButton - r_apply_btn - True - True - GNOME_STOCK_BUTTON_APPLY - - - - GtkButton - r_cancel_btn - True - True - GNOME_STOCK_BUTTON_CANCEL - - + + + yes + yes + yes + gtk-cancel + yes + yes + + + + + 0 + no + yes + GTK_PACK_END + + - - GtkTable - table1 - 2 - 2 - True - 0 - 0 - - 0 - True - True - + + + yes + 0 + 0 + 2 + 2 + yes - - GtkLabel - label2 - - GTK_JUSTIFY_RIGHT - False - 0 - 0.5 - 0 - 0 - - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - False - - + + + Rows + GTK_JUSTIFY_RIGHT + no + 0 + 0.5 + 0 + 0 + yes + + + 0 + 1 + 0 + 1 + 0 + 0 + fill + + + - - GtkLabel - label3 - - GTK_JUSTIFY_RIGHT - False - 0 - 0.5 - 0 - 0 - - 0 - 1 - 1 - 2 - 0 - 0 - False - False - False - False - True - False - - + + + Columns + GTK_JUSTIFY_RIGHT + no + 0 + 0.5 + 0 + 0 + yes + + + 0 + 1 + 1 + 2 + 0 + 0 + fill + + + - - GtkSpinButton - r_rows - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 - 1 - 50 - 1 - 10 - 10 - - 1 - 2 - 0 - 1 - 0 - 0 - True - False - False - False - True - False - - + + + yes + 1 + 0 + no + GTK_UPDATE_ALWAYS + no + no + yes + 1 1 50 1 10 10 + + + 1 + 2 + 0 + 1 + 0 + 0 + expand|fill + + + - - GtkSpinButton - r_cols - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 - 1 - 50 - 1 - 10 - 10 - - 1 - 2 - 1 - 2 - 0 - 0 - True - False - False - False - True - False - + + + yes + 1 + 0 + no + GTK_UPDATE_ALWAYS + no + no + yes + 1 1 50 1 10 10 + + + 1 + 2 + 1 + 2 + 0 + 0 + expand|fill + + + + + + 0 + yes + yes + + - + + 4 + yes + yes + + - - - + diff --git a/src/frontends/gnome/dialogs/GUrl.glade b/src/frontends/gnome/dialogs/GUrl.glade index 0caa3ee45a..6608e41926 100644 --- a/src/frontends/gnome/dialogs/GUrl.glade +++ b/src/frontends/gnome/dialogs/GUrl.glade @@ -1,269 +1,230 @@ - - + + + + + + + 2 + Insert URL + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + + + + 2 + True + False + 8 + + + + 5 + True + GTK_BUTTONBOX_DEFAULT_STYLE + 10 - - diainserturl - diainserturl - - - pixmaps - C - True - True - True - False - False - True - diainserturl_interface.c - diainserturl_interface.h - diainserturl_callbacks.c - diainserturl_callbacks.h - - - - GnomeDialog - GUrl - 2 - False - Insert URL - GTK_WINDOW_DIALOG - GTK_WIN_POS_NONE - False - True - True - False - False - True - - - GtkVBox - GnomeDialog:vbox - dialog-vbox1 - False - 8 - - 4 - True - True - - - - GtkHButtonBox - GnomeDialog:action_area - dialog-action_area1 - GTK_BUTTONBOX_DEFAULT_STYLE - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - - - - GtkButton - r_restore_btn - True - True - - GNOME_STOCK_PIXMAP_UNDO - - - - GtkButton - r_ok_btn - True - True - GNOME_STOCK_BUTTON_OK - - - - GtkButton - r_apply_btn - True - True - GNOME_STOCK_BUTTON_APPLY - - - - GtkButton - r_cancel_btn - True - True - True - GNOME_STOCK_BUTTON_CANCEL - - - - - GtkVBox - vbox1 - False - 2 - - 0 - True - True - - - - GtkTable - table1 - 2 - 2 - False - 2 - 2 - - 0 - True - True - - - - GtkLabel - label2 - - GTK_JUSTIFY_LEFT - False - 0.5 - 0.5 - 0 - 0 - r_name - 0 - 1 - 1 - 2 - 0 - 0 - False - False - False - False - False - False + + True + True + True + Restore + True + GTK_RELIEF_NORMAL + 0 + - - - GtkLabel - label1 - - GTK_JUSTIFY_LEFT - False - 0.5 - 0.5 - 0 - 0 - r_url - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - False + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + 0 + - - - GnomeEntry - url1 - 1 - FormUrl_url - 10 - 1 - 2 - 0 - 1 - 0 - 0 - True - False - False - False - True - False + + True + True + True + gtk-apply + True + GTK_RELIEF_NORMAL + 0 + - - GtkEntry - GnomeEntry:entry - r_url - True - True - True - True - True - True - 0 - - + + + True + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + 0 + + + + 0 + False + True + GTK_PACK_END + + + + + + True + False + 2 - - GnomeEntry - name1 - 1 - FormUrl_name - 10 - 1 - 2 - 1 - 2 - 0 - 0 - True - False - False - False - True - False + + True + 2 + 2 + False + 2 + 2 + + + + True + _Name + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + r_name + + + 0 + 1 + 1 + 2 + + + + + + + + True + _URL + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + r_url + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 0 + 1 + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 1 + 2 + + + + + + 0 + True + True + - - GtkEntry - GnomeEntry:entry - r_name - True - True - True - 0 - - + + + 2 + True + True + _HTML type + True + GTK_RELIEF_NORMAL + False + False + True + + + 0 + False + False + + - - - - GtkCheckButton - r_html_cb - 2 - True - - False - True - - 0 - False - False - - + + 0 + True + True + + - + - + diff --git a/src/frontends/gnome/gnomeBC.C b/src/frontends/gnome/gnomeBC.C index e79bb70931..5fe5cc62b5 100644 --- a/src/frontends/gnome/gnomeBC.C +++ b/src/frontends/gnome/gnomeBC.C @@ -6,8 +6,9 @@ #include "gnomeBC.h" #include "ButtonController.tmpl" -#include "gtk--/widget.h" -#include "gtk--/button.h" + +#include +#include gnomeBC::gnomeBC(string const & cancel, string const & close) : GuiBC(cancel, close) diff --git a/src/frontends/gnome/gnome_helpers.C b/src/frontends/gnome/gnome_helpers.C index 0dd4e2a7d2..08d4c3deec 100644 --- a/src/frontends/gnome/gnome_helpers.C +++ b/src/frontends/gnome/gnome_helpers.C @@ -9,209 +9,6 @@ #include -#include -#include -#include -#include #include "gnome_helpers.h" -string get_font_name(Gdk_Font const & font) -{ - gchar * name = get_font_name(font.gdkobj()); - string name_str(name); - g_free(name); - return name_str; -} - - -gchar * -get_font_name (const GdkFont * font) -{ - Atom font_atom, atom; - bool status = false; - -#ifdef E_FONT_VERBOSE - gint i; - g_print ("Extracting X font info\n"); -#endif - - font_atom = gdk_atom_intern ("FONT", FALSE); - - if (font->type == GDK_FONT_FONTSET) { - XFontStruct **font_structs; - gint num_fonts; - gchar **font_names; - - num_fonts = XFontsOfFontSet ( - static_cast(GDK_FONT_XFONT (font)) - , &font_structs, &font_names); -#ifdef E_FONT_VERBOSE - g_print ("Fonts of fontset:\n"); - for (i = 0; i < num_fonts; i++) g_print (" %s\n", font_names[i]); -#endif - status = XGetFontProperty (font_structs[0], font_atom, &atom); - } else { - status = XGetFontProperty ( - static_cast(GDK_FONT_XFONT (font)) - , font_atom, &atom); - } - - if (status) { - return gdk_atom_name (atom); - } - - return NULL; -} - -#if USE_UNUSED_STUFF_FROM_E_FONT -/* - * Splits full X font name into pieces, overwriting hyphens - */ - -static void -split_name (gchar * c[], gchar * name) -{ - gchar *p; - gint i; - - p = name; - if (*p == '-') p++; - - for (i = 0; i < 12; i++) { - c[i] = p; - /* Skip text */ - while (*p && (*p != '-')) p++; - /* Replace hyphen with '\0' */ - if (*p) *p++ = '\0'; - } - - c[i] = p; -} - -/* - * Find light and bold variants of a font, ideally using the provided - * weight for the light variant, and a weight 2 shades darker than it - * for the bold variant. If there isn't something 2 shades darker, use - * something 3 or more shades darker if it exists, or 1 shade darker - * if that's all there is. If there is nothing darker than the provided - * weight, but there are lighter fonts, then use the darker one for - * bold and a lighter one for light. - */ - -static gboolean -find_variants (gchar **namelist, gint length, gchar *weight, - gchar **lightname, gchar **boldname) -{ - static GHashTable *wh = NULL; - /* Standard, Found, Bold, Light */ - gint sw, fw, bw, lw; - gchar s[32]; - gchar *f, *b, *l; - gchar *p; - gint i; - - if (!wh) { - wh = g_hash_table_new (g_str_hash, g_str_equal); - g_hash_table_insert (wh, "light", GINT_TO_POINTER (1)); - g_hash_table_insert (wh, "book", GINT_TO_POINTER (2)); - g_hash_table_insert (wh, "regular", GINT_TO_POINTER (2)); - g_hash_table_insert (wh, "medium", GINT_TO_POINTER (3)); - g_hash_table_insert (wh, "demibold", GINT_TO_POINTER (5)); - g_hash_table_insert (wh, "bold", GINT_TO_POINTER (6)); - g_hash_table_insert (wh, "black", GINT_TO_POINTER (8)); - } - - g_snprintf (s, 32, weight); - g_strdown (s); - sw = GPOINTER_TO_INT (g_hash_table_lookup (wh, s)); - if (sw == 0) return FALSE; - - fw = 0; lw = 0; bw = 32; - f = NULL; l = NULL; b = NULL; - *lightname = NULL; *boldname = NULL; - - for (i = 0; i < length; i++) { - p = namelist[i]; - if (*p) p++; - while (*p && (*p != '-')) p++; - if (*p) p++; - while (*p && (*p != '-')) p++; - if (*p) p++; - f = p; - while (*p && (*p != '-')) p++; - if (*p) *p = '\0'; - g_strdown (f); - fw = GPOINTER_TO_INT (g_hash_table_lookup (wh, f)); - if (fw) { - if (fw > sw) { - if ((fw - 2 == sw) || - ((fw > bw) && (bw == sw + 1)) || - ((fw < bw) && (fw - 2 > sw))) { - bw = fw; - b = f; - } - } else if (fw < sw) { - if ((fw + 2 == sw) || - ((fw < lw) && (lw == sw - 1)) || - ((fw > lw) && (fw + 2 < sw))) { - lw = fw; - l = f; - } - } - } - } - - if (b) { - *lightname = weight; - *boldname = b; - return TRUE; - } else if (l) { - *lightname = l; - *boldname = weight; - return TRUE; - } - return FALSE; -} -#endif - -#ifdef E_FONT_VERBOSE -/* - * Return newly allocated full name - */ - -static void -e_font_print_gdk_font_name (const GdkFont * font) -{ - Atom font_atom, atom; - Bool status; - - font_atom = gdk_atom_intern ("FONT", FALSE); - - g_print ("-------- start of font description --------\n"); - - if (font == NULL) { - g_print ("GdkFont is NULL\n"); - } else if (font->type == GDK_FONT_FONTSET) { - XFontStruct **font_structs; - gint num_fonts; - gchar **font_names; - gint i; - - num_fonts = XFontsOfFontSet (GDK_FONT_XFONT (font), &font_structs, &font_names); - - g_print ("Gdk Fontset, locale: %s\n", XLocaleOfFontSet (GDK_FONT_XFONT (font))); - for (i = 0; i < num_fonts; i++) { - g_print (" %s\n", font_names[i]); - } - } else { - gchar * name; - status = XGetFontProperty (GDK_FONT_XFONT (font), font_atom, &atom); - name = gdk_atom_name (atom); - g_print ("GdkFont: %s\n", name); - if (name) g_free (name); - } - - g_print ("-------- end of font description --------\n"); -} -#endif diff --git a/src/frontends/gnome/gnome_helpers.h b/src/frontends/gnome/gnome_helpers.h index 8f63fd1d63..48b3d2131a 100644 --- a/src/frontends/gnome/gnome_helpers.h +++ b/src/frontends/gnome/gnome_helpers.h @@ -15,40 +15,9 @@ #endif #include "debug.h" -#include -#include -// Glade Helper Function. - - -/** This function will get a widget from the glade XML representation and - * will wrap it into the gtk--/gnome-- representation. - */ -template -T* getWidgetPtr(GladeXML* xml, char const * name) -{ - T* result = static_cast(Gtk::wrap_auto((GtkObject*)glade_xml_get_widget(xml, name))); - if (result == NULL) - { - lyxerr << "** ERROR **: unable to load widget: " << name << endl; - g_assert(result != NULL); - } - return result; -} - -class Gdk_Font; - -/** Takes a Gdk::Font object reference and returns the name associated - * with the font it holds. - */ -string get_font_name(Gdk_Font const & font); - - -/** Takes a GdkFont pointer and returns the name associated with the font - * it holds. It returns a newly allocated gchar* string. - * - * This function was lifted from e-font.c from the gabber package. - */ -gchar * get_font_name(GdkFont const * font); +#undef Status +#undef Value +#undef DestroyNotify #endif -- 2.39.2