From 74dbe6d5a31bbffaceb99c5a28c482a898ba1e37 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 7 Jul 2007 02:26:02 +0000 Subject: [PATCH] Switched to gtkmm 2.4+ since gtkmm 2.0 is being removed from Debian. --- Makefile | 4 +-- README | 2 +- browser_widget.cpp | 72 +++++++++++++++++++++++----------------------- debian/control | 2 +- generate_dvd.cpp | 4 +-- videolink.cpp | 12 ++++---- 6 files changed, 49 insertions(+), 47 deletions(-) diff --git a/Makefile b/Makefile index 02a8030..e20d8c4 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ CFLAGS := -ansi -Wall -Wunused -Wno-unused-parameter CPPFLAGS := -D_REENTRANT CXXFLAGS := -ansi -Wall -Wunused LDFLAGS := -lpthread \ - $(shell pkg-config --libs gtkmm-2.0 $(mozilla)-gtkmozembed) \ + $(shell pkg-config --libs gtkmm-2.4 $(mozilla)-gtkmozembed) \ -Wl,-rpath -Wl,$(moz_lib_dir) -lexpat ifdef NDEBUG @@ -74,7 +74,7 @@ install : .objs/browser_widget.% .objs/generate_dvd.% .objs/pixbufs.% \ .objs/temp_file.% .objs/vob_list.% .objs/videolink.% .objs/warp_pointer.% \ - : CPPFLAGS += $(shell pkg-config --cflags gtkmm-2.0) + : CPPFLAGS += $(shell pkg-config --cflags gtkmm-2.4) .objs/browser_widget.% .objs/child_iterator.% .objs/link_iterator.% \ .objs/null_prompt_service.% .objs/style_sheets.% .objs/videolink.% \ diff --git a/README b/README index d7b003c..a3147ba 100644 --- a/README +++ b/README @@ -17,7 +17,7 @@ VideoLink depends on the following software: - dvdauthor - expat 1.x -- Gtkmm 2.0 +- Gtkmm 2.4 or later - ffmpeg or mjpegtools - Mozilla 1.8 or later, or XULRunner - netpbm diff --git a/browser_widget.cpp b/browser_widget.cpp index 7d640e5..46d1fb5 100644 --- a/browser_widget.cpp +++ b/browser_widget.cpp @@ -119,15 +119,15 @@ namespace { void browser_widget_signal_link_message_callback(GtkMozEmbed * self, void * data) { - typedef SigC::Slot0 SlotType; + typedef sigc::slot SlotType; if (Glib::ObjectBase::_get_current_wrapper((GObject *)self)) { try { - if (SigC::SlotNode * const slot = + if (sigc::slot_base * const slot = Glib::SignalProxyNormal::data_to_slot(data)) - (*(SlotType::Proxy)(slot->proxy_))(slot); + (*static_cast(slot))(); } catch(...) { @@ -145,15 +145,15 @@ namespace void browser_widget_signal_js_status_callback(GtkMozEmbed * self, void * data) { - typedef SigC::Slot0 SlotType; + typedef sigc::slot SlotType; if (Glib::ObjectBase::_get_current_wrapper((GObject *)self)) { try { - if (SigC::SlotNode * const slot = + if (sigc::slot_base * const slot = Glib::SignalProxyNormal::data_to_slot(data)) - (*(SlotType::Proxy)(slot->proxy_))(slot); + (*static_cast(slot))(); } catch(...) { @@ -171,15 +171,15 @@ namespace void browser_widget_signal_location_callback(GtkMozEmbed * self, void * data) { - typedef SigC::Slot0 SlotType; + typedef sigc::slot SlotType; if (Glib::ObjectBase::_get_current_wrapper((GObject *)self)) { try { - if (SigC::SlotNode * const slot = + if (sigc::slot_base * const slot = Glib::SignalProxyNormal::data_to_slot(data)) - (*(SlotType::Proxy)(slot->proxy_))(slot); + (*static_cast(slot))(); } catch(...) { @@ -197,15 +197,15 @@ namespace void browser_widget_signal_title_callback(GtkMozEmbed * self, void * data) { - typedef SigC::Slot0 SlotType; + typedef sigc::slot SlotType; if (Glib::ObjectBase::_get_current_wrapper((GObject *)self)) { try { - if (SigC::SlotNode * const slot = + if (sigc::slot_base * const slot = Glib::SignalProxyNormal::data_to_slot(data)) - (*(SlotType::Proxy)(slot->proxy_))(slot); + (*static_cast(slot))(); } catch(...) { @@ -224,15 +224,15 @@ namespace void browser_widget_signal_progress_callback( GtkMozEmbed * self, gint p0, gint p1, void * data) { - typedef SigC::Slot2 SlotType; + typedef sigc::slot SlotType; if (Glib::ObjectBase::_get_current_wrapper((GObject *)self)) { try { - if (SigC::SlotNode * const slot = + if (sigc::slot_base * const slot = Glib::SignalProxyNormal::data_to_slot(data)) - (*(SlotType::Proxy)(slot->proxy_))(p0, p1, slot); + (*static_cast(slot))(p0, p1); } catch(...) { @@ -251,15 +251,15 @@ namespace void browser_widget_signal_net_state_callback( GtkMozEmbed * self, const char * p0, gint p1, guint p2, void * data) { - typedef SigC::Slot3 SlotType; + typedef sigc::slot SlotType; if (Glib::ObjectBase::_get_current_wrapper((GObject *)self)) { try { - if (SigC::SlotNode * const slot = + if (sigc::slot_base * const slot = Glib::SignalProxyNormal::data_to_slot(data)) - (*(SlotType::Proxy)(slot->proxy_))(p0, p1, p2, slot); + (*static_cast(slot))(p0, p1, p2); } catch(...) { @@ -277,15 +277,15 @@ namespace void browser_widget_signal_net_start_callback(GtkMozEmbed * self, void * data) { - typedef SigC::Slot0 SlotType; + typedef sigc::slot SlotType; if (Glib::ObjectBase::_get_current_wrapper((GObject *)self)) { try { - if (SigC::SlotNode * const slot = + if (sigc::slot_base * const slot = Glib::SignalProxyNormal::data_to_slot(data)) - (*(SlotType::Proxy)(slot->proxy_))(slot); + (*static_cast(slot))(); } catch(...) { @@ -303,15 +303,15 @@ namespace void browser_widget_signal_net_stop_callback(GtkMozEmbed * self, void * data) { - typedef SigC::Slot0 SlotType; + typedef sigc::slot SlotType; if (Glib::ObjectBase::_get_current_wrapper((GObject *)self)) { try { - if (SigC::SlotNode * const slot = + if (sigc::slot_base * const slot = Glib::SignalProxyNormal::data_to_slot(data)) - (*(SlotType::Proxy)(slot->proxy_))(slot); + (*static_cast(slot))(); } catch(...) { @@ -330,17 +330,17 @@ namespace void browser_widget_signal_new_window_callback( GtkMozEmbed * self, GtkMozEmbed ** p0, guint p1, void * data) { - typedef SigC::Slot1 SlotType; + typedef sigc::slot SlotType; if (Glib::ObjectBase::_get_current_wrapper((GObject *)self)) { try { - if (SigC::SlotNode * const slot = + if (sigc::slot_base * const slot = Glib::SignalProxyNormal::data_to_slot(data)) { if (browser_widget * result = - (*(SlotType::Proxy)(slot->proxy_))(p1, slot)) + (*static_cast(slot))(p1)) { *p0 = result->gobj(); return; @@ -367,15 +367,15 @@ namespace void browser_widget_signal_visibility_callback( GtkMozEmbed * self, gboolean p0, void * data) { - typedef SigC::Slot1 SlotType; + typedef sigc::slot SlotType; if (Glib::ObjectBase::_get_current_wrapper((GObject *)self)) { try { - if (SigC::SlotNode * const slot = + if (sigc::slot_base * const slot = Glib::SignalProxyNormal::data_to_slot(data)) - (*(SlotType::Proxy)(slot->proxy_))(p0, slot); + (*static_cast(slot))(p0); } catch(...) { @@ -394,15 +394,15 @@ namespace void browser_widget_signal_destroy_browser_callback( GtkMozEmbed * self, void * data) { - typedef SigC::Slot0 SlotType; + typedef sigc::slot SlotType; if (Glib::ObjectBase::_get_current_wrapper((GObject *)self)) { try { - if (SigC::SlotNode * const slot = + if (sigc::slot_base * const slot = Glib::SignalProxyNormal::data_to_slot(data)) - (*(SlotType::Proxy)(slot->proxy_))(slot); + (*static_cast(slot))(); } catch(...) { @@ -421,15 +421,15 @@ namespace gint browser_widget_signal_open_uri_callback( GtkMozEmbed * self, const char * p0, void * data) { - typedef SigC::Slot1 SlotType; + typedef sigc::slot SlotType; if (Glib::ObjectBase::_get_current_wrapper((GObject *)self)) { try { - if (SigC::SlotNode * const slot = + if (sigc::slot_base * const slot = Glib::SignalProxyNormal::data_to_slot(data)) - return (*(SlotType::Proxy)(slot->proxy_))(p0, slot); + return (*static_cast(slot))(p0); } catch(...) { diff --git a/debian/control b/debian/control index 4072ffe..375666c 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: videolink Maintainer: Ben Hutchings Section: graphics Priority: extra -Build-Depends: debhelper (>=4), libboost-dev, libgtkmm2.0-dev, libxul-dev | mozilla-dev, libexpat1-dev +Build-Depends: debhelper (>=4), libboost-dev, libgtkmm-2.4-dev, libxul-dev | mozilla-dev, libexpat1-dev Standards-Version: 3.7.2 Package: videolink diff --git a/generate_dvd.cpp b/generate_dvd.cpp index 2fa3388..d695c8e 100644 --- a/generate_dvd.cpp +++ b/generate_dvd.cpp @@ -288,7 +288,7 @@ void dvd_generator::generate_menu_vob(unsigned index, argv, sizeof(argv)/sizeof(argv[0]), Glib::OWNERSHIP_NONE), Glib::SPAWN_STDOUT_TO_DEV_NULL, - SigC::Slot0(), + sigc::slot(), 0, 0, &command_result); if (command_result != 0) @@ -707,7 +707,7 @@ void dvd_generator::generate(const std::string & output_dir) const Glib::OWNERSHIP_NONE), Glib::SPAWN_SEARCH_PATH | Glib::SPAWN_STDOUT_TO_DEV_NULL, - SigC::Slot0(), + sigc::slot(), 0, 0, &command_result); if (command_result != 0) diff --git a/videolink.cpp b/videolink.cpp index ca41933..ef30510 100644 --- a/videolink.cpp +++ b/videolink.cpp @@ -160,7 +160,8 @@ namespace add(browser_widget_); browser_widget_.show(); - Glib::signal_idle().connect(SigC::slot(*this, &base_window::on_idle)); + Glib::signal_idle().connect( + sigc::mem_fun(this, &base_window::on_idle)); } bool base_window::on_idle() @@ -187,7 +188,8 @@ namespace : base_window(frame_params), main_page_uri_(main_page_uri) { - signal_key_press_event().connect(SigC::slot(*this, &preview_window::on_key_press)); + signal_key_press_event().connect( + sigc::mem_fun(this, &preview_window::on_key_press)); } void preview_window::do_late_initialisation() @@ -276,7 +278,7 @@ namespace finished_(false) { browser_widget_.signal_net_state().connect( - SigC::slot(*this, &conversion_window::on_net_state_change)); + sigc::mem_fun(this, &conversion_window::on_net_state_change)); add_menu(main_page_uri); } @@ -963,7 +965,7 @@ int main(int argc, char ** argv) { preview_window window(frame_params, menu_url); window.show(); - window.signal_hide().connect(SigC::slot(&Gtk::Main::quit)); + window.signal_hide().connect(sigc::ptr_fun(Gtk::Main::quit)); Gtk::Main::run(); return EXIT_SUCCESS; } @@ -971,7 +973,7 @@ int main(int argc, char ** argv) { conversion_window window(frame_params, menu_url, output_dir, encoder); window.show(); - window.signal_hide().connect(SigC::slot(&Gtk::Main::quit)); + window.signal_hide().connect(sigc::ptr_fun(Gtk::Main::quit)); Gtk::Main::run(); return window.is_finished() ? EXIT_SUCCESS : EXIT_FAILURE; } -- 2.39.5