[gtkmm/gtkmm-2-22] Remove the ifdefs that supported building with optional API.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm/gtkmm-2-22] Remove the ifdefs that supported building with optional API.
- Date: Tue, 18 May 2010 09:25:02 +0000 (UTC)
commit de55f38fc8494d805b492c6fdeea5450a7fe4484
Author: Murray Cumming <murrayc murrayc com>
Date: Tue May 18 11:24:53 2010 +0200
Remove the ifdefs that supported building with optional API.
As discussed on the mailing list, these will be removed from glibmm soon
anyway. Anybody who really still needs this should tell us.
ChangeLog | 11 ++-
demos/gtk-demo/demo-common.cc | 4 -
demos/gtk-demo/demowindow.cc | 22 +---
demos/gtk-demo/example_iconview.cc | 26 ----
demos/gtk-demo/example_images.cc | 59 --------
demos/gtk-demo/example_menus.cc | 4 -
demos/gtk-demo/example_pixbufs.cc | 10 --
demos/gtk-demo/example_textview.cc | 65 ---------
demos/gtk-demo/example_treeview_editable_cells.cc | 8 -
demos/gtk-demo/example_treeview_treestore.cc | 47 -------
demos/gtk-demo/example_uimanager.cc | 9 --
demos/gtk-demo/textwidget.cc | 31 -----
demos/pixbuf-demo.cc | 16 ---
gdk/src/image.hg | 6 +-
gdk/src/pixbuf.ccg | 64 ---------
gdk/src/pixbuf.hg | 30 ----
gdk/src/pixbufanimation.ccg | 9 --
gdk/src/pixbufanimation.hg | 4 -
gtk/gtkmm/cellrenderer_generation.cc | 8 -
gtk/gtkmm/cellrenderer_generation.h | 4 -
gtk/gtkmm/treeview_private.cc | 8 -
gtk/src/aboutdialog.ccg | 4 -
gtk/src/assistant.ccg | 4 -
gtk/src/builder.ccg | 148 ---------------------
gtk/src/builder.hg | 58 --------
gtk/src/calendar.ccg | 4 -
gtk/src/celllayout.ccg | 6 -
gtk/src/celllayout.hg | 9 +-
gtk/src/cellrenderer.ccg | 8 -
gtk/src/cellrenderer.hg | 4 -
gtk/src/cellrendereraccel.ccg | 2 -
gtk/src/cellrendereraccel.hg | 2 -
gtk/src/cellrenderercombo.ccg | 7 -
gtk/src/cellrenderercombo.hg | 4 -
gtk/src/cellrendererpixbuf.ccg | 7 -
gtk/src/cellrendererpixbuf.hg | 4 -
gtk/src/cellrendererprogress.ccg | 7 -
gtk/src/cellrendererprogress.hg | 4 -
gtk/src/cellrendererspin.ccg | 2 -
gtk/src/cellrendererspin.hg | 2 -
gtk/src/cellrenderertext.ccg | 7 -
gtk/src/cellrenderertext.hg | 4 -
gtk/src/cellrenderertoggle.ccg | 7 -
gtk/src/cellrenderertoggle.hg | 4 -
gtk/src/cellview.ccg | 12 --
gtk/src/clipboard.ccg | 32 -----
gtk/src/colorselection.ccg | 8 -
gtk/src/container.ccg | 16 ---
gtk/src/entrycompletion.ccg | 26 ----
gtk/src/entrycompletion.hg | 2 -
gtk/src/filefilter.ccg | 4 -
gtk/src/iconview.ccg | 4 -
gtk/src/linkbutton.ccg | 4 -
gtk/src/main.ccg | 20 ---
gtk/src/menu.ccg | 4 -
gtk/src/menuitem.ccg | 4 -
gtk/src/menushell.ccg | 6 -
gtk/src/notebook.ccg | 4 -
gtk/src/pagesetup.ccg | 33 -----
gtk/src/pagesetup.hg | 16 ---
gtk/src/printer.ccg | 4 -
gtk/src/printjob.ccg | 9 --
gtk/src/printjob.hg | 7 -
gtk/src/printoperation.ccg | 16 ---
gtk/src/printoperation.hg | 4 -
gtk/src/printsettings.ccg | 37 -----
gtk/src/printsettings.hg | 16 ---
gtk/src/recentchooser.ccg | 4 -
gtk/src/recentfilter.ccg | 4 -
gtk/src/textbuffer.ccg | 8 -
gtk/src/textiter.hg | 4 -
gtk/src/treedragsource.ccg | 6 -
gtk/src/treedragsource.hg | 2 -
gtk/src/treemodel.ccg | 38 ------
gtk/src/treemodel.hg | 4 -
gtk/src/treemodelfilter.ccg | 8 -
gtk/src/treeselection.ccg | 16 ---
gtk/src/treesortable.ccg | 4 -
gtk/src/treeview.ccg | 16 ---
gtk/src/treeview.hg | 36 -----
gtk/src/treeviewcolumn.ccg | 6 -
gtk/src/treeviewcolumn.hg | 2 -
gtk/src/uimanager.ccg | 8 -
gtk/src/uimanager.hg | 4 -
gtk/src/widget.ccg | 20 ---
gtk/src/widget.hg | 6 +-
gtk/src/window.hg | 4 -
tests/main_with_options/main.cc | 4 -
tests/property_notification/main.cc | 1 -
89 files changed, 15 insertions(+), 1231 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 91d5eb9..b8fee44 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-05-18 Murray Cumming <murrayc murrayc com>
+
+ Remove the ifdefs that supported building with optional API.
+
+ As discussed on the mailing list, these will be removed from glibmm soon
+ anyway. Anybody who really still needs this should tell us.
+
This is the gtkmm-2-22 branch for new API.
See also the stable gtkmm-2-20 branch, which should have no more API additions,
and the master branch for the planned API/ABI-breaking gtkmm 3.
@@ -8,8 +15,8 @@ and the master branch for the planned API/ABI-breaking gtkmm 3.
FileChooser::get_filter(): Don't ref the result.
- * gtk/src/filechooser.hg: get_filter(): Don't ref the GtkFilter results,
- because it is a GtkObject, not just a GObject, and we should not
+ * gtk/src/filechooser.hg: get_filter(): Don't ref the GtkFilter results,
+ because it is a GtkObject, not just a GObject, and we should not
reference-count GtkObjects. This does _not_ fix bug #583481 though.
2010-04-23 David King <davidk openismus com>
diff --git a/demos/gtk-demo/demo-common.cc b/demos/gtk-demo/demo-common.cc
index 329cebf..83e4bc7 100644
--- a/demos/gtk-demo/demo-common.cc
+++ b/demos/gtk-demo/demo-common.cc
@@ -54,11 +54,7 @@ std::string demo_find_file(const std::string& base)
{
Glib::ustring msg = "Cannot find demo data file " + base;
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
throw Glib::FileError(Glib::FileError::NO_SUCH_ENTITY, msg);
- #else
- std::cerr << "File Error: " << msg << std::endl;
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return Glib::ustring();
}
diff --git a/demos/gtk-demo/demowindow.cc b/demos/gtk-demo/demowindow.cc
index 3ac4349..4079d6b 100644
--- a/demos/gtk-demo/demowindow.cc
+++ b/demos/gtk-demo/demowindow.cc
@@ -135,20 +135,11 @@ void DemoWindow::fill_tree()
}
Gtk::CellRendererText* pCell = Gtk::manage(new Gtk::CellRendererText());
-#ifdef GLIBMM_PROPERTIES_ENABLED
pCell->property_style() = Pango::STYLE_ITALIC;
-#else
- pCell->set_property("style", Pango::STYLE_ITALIC);
-#endif
Gtk::TreeViewColumn* pColumn = new Gtk::TreeViewColumn("Widget (double click for demo)", *pCell);
-#ifdef GLIBMM_PROPERTIES_ENABLED
pColumn->add_attribute(pCell->property_text(), columns.title);
pColumn->add_attribute(pCell->property_style_set(), columns.italic);
-#else
- pColumn->add_attribute(*pCell, "text", columns.title);
- pColumn->add_attribute(*pCell, "style_set", columns.italic);
-#endif
m_TreeView.append_column(*pColumn);
@@ -200,12 +191,7 @@ void DemoWindow::on_treeselection_changed()
{
const Glib::ustring filename = (*iter)[demo_columns().filename];
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
load_file(Glib::filename_from_utf8(filename));
- #else
- std::auto_ptr<Glib::Error> error;
- load_file(Glib::filename_from_utf8(filename, error));
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
}
@@ -225,9 +211,7 @@ bool DemoWindow::read_line (FILE *stream, GString *str)
#ifdef HAVE_GETC_UNLOCKED
c = getc_unlocked (stream);
-#else
- c = getc(stream);
-#endif
+#endif //GLIBMM_PROPERTIES_ENABLED
if (c == EOF)
goto done;
else
@@ -240,9 +224,7 @@ bool DemoWindow::read_line (FILE *stream, GString *str)
{
#ifdef HAVE_GETC_UNLOCKED
int next_c = getc_unlocked (stream);
-#else
- int next_c = getc(stream);
-#endif
+#endif //GLIBMM_PROPERTIES_ENABLED
if (!(next_c == EOF ||
(c == '\r' && next_c == '\n') ||
(c == '\n' && next_c == '\r')))
diff --git a/demos/gtk-demo/example_iconview.cc b/demos/gtk-demo/example_iconview.cc
index 0ff62d6..53b6b4c 100644
--- a/demos/gtk-demo/example_iconview.cc
+++ b/demos/gtk-demo/example_iconview.cc
@@ -67,7 +67,6 @@ Example_IconView::Example_IconView()
set_title("Icon View");
set_default_size(650, 400);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
Glib::ustring filename = demo_find_file("gnome-fs-regular.png");
@@ -79,22 +78,6 @@ Example_IconView::Example_IconView()
{
std::cout << error.what() << std::endl;
}
- #else
- Glib::ustring filename = demo_find_file("gnome-fs-regular.png");
- std::auto_ptr<Glib::Error> error;
- m_refPixbufFile = Gdk::Pixbuf::create_from_file(filename, error);
-
- if(!error.get())
- {
- filename = demo_find_file("gnome-fs-directory.png");
- m_refPixbufFolder = Gdk::Pixbuf::create_from_file(filename, error);
- }
-
- if(error.get())
- {
- std::cout << error->what() << std::endl;
- }
- #endif //GLIBMM_EXCEPTIONS_ENABLED
m_VBox.pack_start(m_Toolbar, Gtk::PACK_SHRINK);
@@ -198,10 +181,8 @@ void Example_IconView::fill_store()
/* Now go through the directory and extract all the file
* information */
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
Glib::Dir dir(m_parent); //throws an exception if it fails.
std::string name = dir.read_name();
@@ -213,12 +194,7 @@ void Example_IconView::fill_store()
std::string path = Glib::build_filename(m_parent, name);
bool is_dir = Glib::file_test(path, Glib::FILE_TEST_IS_DIR);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::ustring display_name = Glib::filename_to_utf8(name);
- #else
- std::auto_ptr<Glib::Error> error;
- Glib::ustring display_name = Glib::filename_to_utf8(name, error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
Gtk::TreeModel::iterator iter = m_model->append();
Gtk::TreeModel::Row row = *iter;
@@ -230,13 +206,11 @@ void Example_IconView::fill_store()
name = dir.read_name();
}
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(const Glib::FileError& ex)
{
std::cout << ex.what() << std::endl;
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
diff --git a/demos/gtk-demo/example_images.cc b/demos/gtk-demo/example_images.cc
index 80f8f71..ecc2237 100644
--- a/demos/gtk-demo/example_images.cc
+++ b/demos/gtk-demo/example_images.cc
@@ -116,7 +116,6 @@ Example_Images::Example_Images()
Example_Images::~Example_Images()
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
if(m_refPixbufLoader)
@@ -126,11 +125,6 @@ Example_Images::~Example_Images()
{
// ignore errors
}
- #else
- std::auto_ptr<Glib::Error> error;
- if(m_refPixbufLoader)
- m_refPixbufLoader->close(error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
void Example_Images::start_progressive_loading()
@@ -151,26 +145,15 @@ bool Example_Images::on_timeout()
gsize bytes_read = 0;
Glib::IOStatus status = Glib::IO_STATUS_NORMAL;
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
status = m_image_stream->read(reinterpret_cast<char*>(&buf[0]), sizeof(buf), bytes_read);
}
catch(const Glib::Error& error)
{
- #else
- std::auto_ptr<Glib::Error> error;
- status = m_image_stream->read(reinterpret_cast<char*>(&buf[0]), sizeof(buf), bytes_read, error);
- if(error.get())
- {
- #endif //GLIBMM_EXCEPTIONS_ENABLED
Glib::ustring strMsg = "Failure reading image file 'alphatest.png': ";
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
strMsg += error.what();
- #else
- strMsg += error->what();
- #endif //GLIBMM_EXCEPTIONS_ENABLED
Gtk::MessageDialog dialog(strMsg, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE);
dialog.run();
@@ -180,26 +163,15 @@ bool Example_Images::on_timeout()
return false; // uninstall the timeout
}
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
m_refPixbufLoader->write(buf, bytes_read);
}
catch(const Glib::Error& error)
{
- #else
- //std::auto_ptr<Glib::Error> error;
- m_refPixbufLoader->write(buf, bytes_read, error);
- if(error.get())
- {
- #endif //GLIBMM_EXCEPTIONS_ENABLED
Glib::ustring strMsg = "Failed to load image: ";
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
strMsg += error.what();
- #else
- strMsg += error->what();
- #endif //GLIBMM_EXCEPTIONS_ENABLED
Gtk::MessageDialog dialog(strMsg, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE);
dialog.run();
@@ -218,26 +190,15 @@ bool Example_Images::on_timeout()
* it was incomplete.
*/
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
m_refPixbufLoader->close();
}
catch(const Glib::Error& error)
{
- #else
- std::auto_ptr<Glib::Error> error;
- m_refPixbufLoader->close(error);
- if(error.get())
- {
- #endif //GLIBMM_EXCEPTIONS_ENABLED
Glib::ustring strMsg = "Failed to load image: ";
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
strMsg += error.what();
- #else
- strMsg += error->what();
- #endif //GLIBMM_EXCEPTIONS_ENABLED
Gtk::MessageDialog dialog(strMsg, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE);
dialog.run();
@@ -252,26 +213,15 @@ bool Example_Images::on_timeout()
}
else
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
m_image_stream = Glib::IOChannel::create_from_file(demo_find_file("alphatest.png"), "r");
}
catch(const Glib::Error& error)
{
- #else
- std::auto_ptr<Glib::Error> error;
- m_image_stream = Glib::IOChannel::create_from_file(demo_find_file("alphatest.png"), "r", error);
- if(error.get())
- {
- #endif //GLIBMM_EXCEPTIONS_ENABLED
Glib::ustring strMsg = "Unable to open image file 'alphatest.png': ";
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
strMsg += error.what();
- #else
- strMsg += error->what();
- #endif //GLIBMM_EXCEPTIONS_ENABLED
Gtk::MessageDialog dialog(strMsg, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE);
dialog.run();
@@ -279,20 +229,11 @@ bool Example_Images::on_timeout()
return false; // uninstall the timeout
}
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
m_image_stream->set_encoding(); // no encoding == binary
- #else
- m_image_stream->set_encoding("", error); // no encoding == binary
- #endif //GLIBMM_EXCEPTIONS_ENABLED
if(m_refPixbufLoader)
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
m_refPixbufLoader->close();
- #else
- std::auto_ptr<Glib::Error> error;
- m_refPixbufLoader->close(error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
m_refPixbufLoader.clear();
}
diff --git a/demos/gtk-demo/example_menus.cc b/demos/gtk-demo/example_menus.cc
index c6202fc..a286c53 100644
--- a/demos/gtk-demo/example_menus.cc
+++ b/demos/gtk-demo/example_menus.cc
@@ -113,11 +113,7 @@ Example_Menus::Example_Menus()
m_Button.signal_clicked().connect(sigc::mem_fun(*this, &Example_Menus::on_button_clicked));
m_VBox_Sub2.pack_start(m_Button);
-#ifdef GLIBMM_PROPERTIES_ENABLED
m_Button.property_can_default() = true;
-#else
- m_Button.set_property("can_default", true);
-#endif
m_Button.grab_default();
show_all();
diff --git a/demos/gtk-demo/example_pixbufs.cc b/demos/gtk-demo/example_pixbufs.cc
index 47d4953..d6af32f 100644
--- a/demos/gtk-demo/example_pixbufs.cc
+++ b/demos/gtk-demo/example_pixbufs.cc
@@ -108,12 +108,7 @@ void Example_Pixbufs::load_pixbufs()
std::string filename_background = BACKGROUND_NAME;
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
m_refPixbuf_Background = Gdk::Pixbuf::create_from_file(demo_find_file(filename_background));
- #else
- std::auto_ptr<Glib::Error> error;
- m_refPixbuf_Background = Gdk::Pixbuf::create_from_file(demo_find_file(filename_background), error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
m_back_width = m_refPixbuf_Background->get_width();
m_back_height = m_refPixbuf_Background->get_height();
@@ -122,12 +117,7 @@ void Example_Pixbufs::load_pixbufs()
{
std::string filename = image_names[i];
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::RefPtr<Gdk::Pixbuf> pixbuf = Gdk::Pixbuf::create_from_file(demo_find_file(filename));
- #else
- std::auto_ptr<Glib::Error> error;
- Glib::RefPtr<Gdk::Pixbuf> pixbuf = Gdk::Pixbuf::create_from_file(demo_find_file(filename), error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
m_images[i] = pixbuf;
}
diff --git a/demos/gtk-demo/example_textview.cc b/demos/gtk-demo/example_textview.cc
index fa1ec38..73549a6 100644
--- a/demos/gtk-demo/example_textview.cc
+++ b/demos/gtk-demo/example_textview.cc
@@ -124,15 +124,9 @@ void Example_TextView::create_tags(Glib::RefPtr<Gtk::TextBuffer>& refBuffer)
Glib::RefPtr<Gtk::TextBuffer::Tag> refTag;
refTag = refBuffer->create_tag("heading");
-#ifdef GLIBMM_PROPERTIES_ENABLED
refTag->property_weight() = Pango::WEIGHT_BOLD;
refTag->property_size() = 15 * Pango::SCALE;
-#else
- refTag->set_property("weight", Pango::WEIGHT_BOLD);
- refTag->set_property("size", 15 * Pango::SCALE);
-#endif
-#ifdef GLIBMM_PROPERTIES_ENABLED
refBuffer->create_tag("italic")->property_style() = Pango::STYLE_ITALIC;
refBuffer->create_tag("bold")->property_weight() = Pango::WEIGHT_BOLD;
refBuffer->create_tag("big")->property_size() = 20 * Pango::SCALE;
@@ -141,23 +135,12 @@ void Example_TextView::create_tags(Glib::RefPtr<Gtk::TextBuffer>& refBuffer)
refBuffer->create_tag("monospace")->property_family() = "monospace";
refBuffer->create_tag("blue_foreground")->property_foreground() = "blue";
refBuffer->create_tag("red_background")->property_background() = "red";
-#else
- refBuffer->create_tag("italic")->set_property("style", Pango::STYLE_ITALIC);
- refBuffer->create_tag("bold")->set_property("weight", Pango::WEIGHT_BOLD);
- refBuffer->create_tag("big")->set_property("size", 20 * Pango::SCALE);
- refBuffer->create_tag("xx-small")->set_property("scale", Pango::SCALE_XX_SMALL);
- refBuffer->create_tag("x-large")->set_property("scale", Pango::SCALE_X_LARGE);
- refBuffer->create_tag("monospace")->set_property("family", Glib::ustring("monospace"));
- refBuffer->create_tag("blue_foreground")->set_property("foreground", Glib::ustring("blue"));
- refBuffer->create_tag("red_background")->set_property("background", Glib::ustring("red"));
-#endif
enum { gray50_width = 2, gray50_height = 2 };
static const char gray50_bits[] = { 0x02, 0x01 };
Glib::RefPtr<Gdk::Bitmap> refStipple = Gdk::Bitmap::create(gray50_bits, gray50_width, gray50_height);
-#ifdef GLIBMM_PROPERTIES_ENABLED
refBuffer->create_tag("background_stipple")->property_background_stipple() = refStipple;
refBuffer->create_tag("foreground_stipple")->property_foreground_stipple() = refStipple;
@@ -170,82 +153,34 @@ void Example_TextView::create_tags(Glib::RefPtr<Gtk::TextBuffer>& refBuffer)
refBuffer->create_tag("no_wrap")->property_wrap_mode() = Gtk::WRAP_NONE;
refBuffer->create_tag("center")->property_justification() = Gtk::JUSTIFY_CENTER;
refBuffer->create_tag("right_justify")->property_justification() = Gtk::JUSTIFY_RIGHT;
-#else
- refBuffer->create_tag("background_stipple")->set_property("background_stipple", refStipple);
- refBuffer->create_tag("foreground_stipple")->set_property("foreground_stipple", refStipple);
-
- refBuffer->create_tag("big_gap_before_line")->set_property("pixels_above_lines", 30);
- refBuffer->create_tag("big_gap_after_line")->set_property("pixels_below_lines", 30);
- refBuffer->create_tag("double_spaced_line")->set_property("pixels_inside_wrap", 10);
- refBuffer->create_tag("not_editable")->set_property("editable", FALSE);
- refBuffer->create_tag("word_wrap")->set_property("wrap_mode", Gtk::WRAP_WORD);
- refBuffer->create_tag("char_wrap")->set_property("wrap_mode", Gtk::WRAP_CHAR);
- refBuffer->create_tag("no_wrap")->set_property("wrap_mode", Gtk::WRAP_NONE);
- refBuffer->create_tag("center")->set_property("justification", Gtk::JUSTIFY_CENTER);
- refBuffer->create_tag("right_justify")->set_property("justification", Gtk::JUSTIFY_RIGHT);
-#endif
refTag = refBuffer->create_tag("wide_margins");
-#ifdef GLIBMM_PROPERTIES_ENABLED
refTag->property_left_margin() = 50;
refTag->property_right_margin() = 50;
-#else
- refTag->set_property("left_margin", 50);
- refTag->set_property("right_margin", 50);
-#endif
-#ifdef GLIBMM_PROPERTIES_ENABLED
refBuffer->create_tag("strikethrough")->property_strikethrough() = true;
refBuffer->create_tag("underline")->property_underline() = Pango::UNDERLINE_SINGLE;
refBuffer->create_tag("double_underline")->property_underline() = Pango::UNDERLINE_DOUBLE;
-#else
- refBuffer->create_tag("strikethrough")->set_property("strikethrough", true);
- refBuffer->create_tag("underline")->set_property("underline", Pango::UNDERLINE_SINGLE);
- refBuffer->create_tag("double_underline")->set_property("underline", Pango::UNDERLINE_DOUBLE);
-#endif
refTag = refBuffer->create_tag("superscript");
-#ifdef GLIBMM_PROPERTIES_ENABLED
refTag->property_rise() = 10 * Pango::SCALE; /* 10 pixels */
refTag->property_size() = 8 * Pango::SCALE; /* 8 points */
-#else
- refTag->set_property("rise", 10 * Pango::SCALE); /* 10 pixels */
- refTag->set_property("size", 8 * Pango::SCALE); /* 8 points */
-#endif
refTag = refBuffer->create_tag("subscript");
-#ifdef GLIBMM_PROPERTIES_ENABLED
refTag->property_rise() = -10 * Pango::SCALE; /* 10 pixels */
refTag->property_size() = 8 * Pango::SCALE; /* 8 points */
-#else
- refTag->set_property("rise", 10 * Pango::SCALE); /* 10 pixels */
- refTag->set_property("size", 8 * Pango::SCALE); /* 8 points */
-#endif
refTag = refBuffer->create_tag("rtl_quote");
-#ifdef GLIBMM_PROPERTIES_ENABLED
refTag->property_wrap_mode() = Gtk::WRAP_WORD;
refTag->property_direction() = Gtk::TEXT_DIR_RTL;
refTag->property_indent() = 30;
refTag->property_left_margin() = 20;
refTag->property_right_margin() = 20;
-#else
- refTag->set_property("wrap_mode", Gtk::WRAP_WORD);
- refTag->set_property("direction", Gtk::TEXT_DIR_RTL);
- refTag->set_property("indent", 30);
- refTag->set_property("left_margin", 20);
- refTag->set_property("right_margin", 20);
-#endif
}
void Example_TextView::insert_text(Glib::RefPtr<Gtk::TextBuffer>& refBuffer)
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::RefPtr<Gdk::Pixbuf> refPixbuf = Gdk::Pixbuf::create_from_file(demo_find_file("gtk-logo-rgb.gif"));
- #else
- std::auto_ptr<Glib::Error> error;
- Glib::RefPtr<Gdk::Pixbuf> refPixbuf = Gdk::Pixbuf::create_from_file(demo_find_file("gtk-logo-rgb.gif"), error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
if(!refPixbuf)
{
diff --git a/demos/gtk-demo/example_treeview_editable_cells.cc b/demos/gtk-demo/example_treeview_editable_cells.cc
index ad8e930..a2958cd 100644
--- a/demos/gtk-demo/example_treeview_editable_cells.cc
+++ b/demos/gtk-demo/example_treeview_editable_cells.cc
@@ -252,11 +252,7 @@ void Example_TreeView_EditableCells::add_columns()
if(pCellRenderText)
{
//Set the appropriate property,
-#ifdef GLIBMM_PROPERTIES_ENABLED
pCellRenderText->property_editable() = true;
-#else
- pCellRenderText->set_property("editable", true);
-#endif
//Connect to the appropriate signal, sending the model_column too,
pCellRenderText->signal_edited().connect( sigc::mem_fun(*this, &Example_TreeView_EditableCells::on_column_number_edited) );
@@ -274,11 +270,7 @@ void Example_TreeView_EditableCells::add_columns()
if(pCellRenderText)
{
//Set the appropriate property,
- #ifdef GLIBMM_PROPERTIES_ENABLED
pCellRenderText->property_editable() = true;
- #else
- pCellRenderText->set_property("editable", true);
- #endif
//Connect to the appropriate signal, sending the model_column too,
pCellRenderText->signal_edited().connect( sigc::mem_fun(*this, &Example_TreeView_EditableCells::on_column_product_edited) );
diff --git a/demos/gtk-demo/example_treeview_treestore.cc b/demos/gtk-demo/example_treeview_treestore.cc
index 995753f..3aaba1f 100644
--- a/demos/gtk-demo/example_treeview_treestore.cc
+++ b/demos/gtk-demo/example_treeview_treestore.cc
@@ -334,11 +334,7 @@ void Example_TreeView_TreeStore::add_columns()
if(pColumn)
{
Gtk::CellRenderer* pRenderer = pColumn->get_first_cell_renderer();
- #ifdef GLIBMM_PROPERTIES_ENABLED
pRenderer->property_xalign().set_value(0.0);
- #else
- pRenderer->set_property("xalign", 0.0f);
- #endif
pColumn->set_clickable();
}
@@ -351,19 +347,10 @@ void Example_TreeView_TreeStore::add_columns()
if(pColumn)
{
Gtk::CellRendererToggle* pRenderer = static_cast<Gtk::CellRendererToggle*>(pColumn->get_first_cell_renderer());
- #ifdef GLIBMM_PROPERTIES_ENABLED
pRenderer->property_xalign().set_value(0.0);
- #else
- pRenderer->set_property("xalign", 0.0f);
- #endif
- #ifdef GLIBMM_PROPERTIES_ENABLED
pColumn->add_attribute(pRenderer->property_visible(), m_columns.visible);
pColumn->add_attribute(pRenderer->property_activatable(), m_columns.world);
- #else
- pColumn->add_attribute(*pRenderer, "visible", m_columns.visible);
- pColumn->add_attribute(*pRenderer, "activatable", m_columns.world);
- #endif
pColumn->set_sizing(Gtk::TREE_VIEW_COLUMN_FIXED);
pColumn->set_fixed_width(50);
@@ -378,17 +365,9 @@ void Example_TreeView_TreeStore::add_columns()
if(pColumn)
{
Gtk::CellRendererToggle* pRenderer = static_cast<Gtk::CellRendererToggle*>(pColumn->get_first_cell_renderer());
- #ifdef GLIBMM_PROPERTIES_ENABLED
pRenderer->property_xalign().set_value(0.0);
- #else
- pRenderer->set_property("xalign", 0.0f);
- #endif
- #ifdef GLIBMM_PROPERTIES_ENABLED
pColumn->add_attribute(pRenderer->property_visible(), m_columns.visible);
- #else
- pColumn->add_attribute(*pRenderer, "visible", m_columns.visible);
- #endif
pColumn->set_sizing(Gtk::TREE_VIEW_COLUMN_FIXED);
pColumn->set_fixed_width(50);
@@ -403,19 +382,10 @@ void Example_TreeView_TreeStore::add_columns()
if(pColumn)
{
Gtk::CellRendererToggle* pRenderer = static_cast<Gtk::CellRendererToggle*>(pColumn->get_first_cell_renderer());
- #ifdef GLIBMM_PROPERTIES_ENABLED
pRenderer->property_xalign().set_value(0.0);
- #else
- pRenderer->set_property("xalign", 0.0f);
- #endif
- #ifdef GLIBMM_PROPERTIES_ENABLED
pColumn->add_attribute(pRenderer->property_visible(), m_columns.visible);
pColumn->add_attribute(pRenderer->property_activatable(), m_columns.world);
- #else
- pColumn->add_attribute(*pRenderer, "visible", m_columns.visible);
- pColumn->add_attribute(*pRenderer, "activatable", m_columns.world);
- #endif
pColumn->set_sizing(Gtk::TREE_VIEW_COLUMN_FIXED);
pColumn->set_fixed_width(50);
@@ -430,17 +400,9 @@ void Example_TreeView_TreeStore::add_columns()
if(pColumn)
{
Gtk::CellRendererToggle* pRenderer = static_cast<Gtk::CellRendererToggle*>(pColumn->get_first_cell_renderer());
- #ifdef GLIBMM_PROPERTIES_ENABLED
pRenderer->property_xalign().set_value(0.0);
- #else
- pRenderer->set_property("xalign", 0.0f);
- #endif
- #ifdef GLIBMM_PROPERTIES_ENABLED
pColumn->add_attribute(pRenderer->property_visible(), m_columns.visible);
- #else
- pColumn->add_attribute(*pRenderer, "visible", m_columns.visible);
- #endif
pColumn->set_sizing(Gtk::TREE_VIEW_COLUMN_FIXED);
pColumn->set_fixed_width(50);
@@ -455,17 +417,9 @@ void Example_TreeView_TreeStore::add_columns()
if(pColumn)
{
Gtk::CellRendererToggle* pRenderer = static_cast<Gtk::CellRendererToggle*>(pColumn->get_first_cell_renderer());
- #ifdef GLIBMM_PROPERTIES_ENABLED
pRenderer->property_xalign().set_value(0.0);
- #else
- pRenderer->set_property("xalign", 0.0f);
- #endif
- #ifdef GLIBMM_PROPERTIES_ENABLED
pColumn->add_attribute(pRenderer->property_visible(), m_columns.visible);
- #else
- pColumn->add_attribute(*pRenderer, "visible", m_columns.visible);
- #endif
pColumn->set_sizing(Gtk::TREE_VIEW_COLUMN_FIXED);
pColumn->set_fixed_width(50);
@@ -478,7 +432,6 @@ void Example_TreeView_TreeStore::add_columns()
void Example_TreeView_TreeStore::on_realize()
{
m_TreeView.expand_all();
-#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
//call base class:
Window::on_realize();
#endif
diff --git a/demos/gtk-demo/example_uimanager.cc b/demos/gtk-demo/example_uimanager.cc
index 4c457db..2cb51e9 100644
--- a/demos/gtk-demo/example_uimanager.cc
+++ b/demos/gtk-demo/example_uimanager.cc
@@ -158,7 +158,6 @@ Example_UIManager::Example_UIManager()
" </toolbar>"
"</ui>";
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
m_refUIManager->add_ui_from_string(ui_info);
@@ -167,14 +166,6 @@ Example_UIManager::Example_UIManager()
{
std::cerr << "building menus failed: " << ex.what();
}
- #else
- std::auto_ptr<Glib::Error> error;
- m_refUIManager->add_ui_from_string(ui_info, error);
- if(error.get())
- {
- std::cerr << "building menus failed: " << error->what();
- }
- #endif //GLIBMM_EXCEPTIONS_ENABLED
add(m_Box1);
Gtk::Widget* pMenuBar = m_refUIManager->get_widget("/MenuBar") ;
diff --git a/demos/gtk-demo/textwidget.cc b/demos/gtk-demo/textwidget.cc
index 2b06b63..5405179 100644
--- a/demos/gtk-demo/textwidget.cc
+++ b/demos/gtk-demo/textwidget.cc
@@ -48,54 +48,27 @@ TextWidget::TextWidget(bool is_source)
m_TextView.set_wrap_mode (Gtk::WRAP_NONE);
Glib::RefPtr<Gtk::TextBuffer::Tag> refTag = m_refTextBuffer->create_tag("comment");
-#ifdef GLIBMM_PROPERTIES_ENABLED
refTag->property_foreground() = "red";
-#else
- refTag->set_property("foreground", Glib::ustring("red"));
-#endif
refTag = m_refTextBuffer->create_tag("type");
-#ifdef GLIBMM_PROPERTIES_ENABLED
refTag->property_foreground() = "ForestGreen";
-#else
- refTag->set_property("foreground", Glib::ustring("ForestGreen"));
-#endif
refTag = m_refTextBuffer->create_tag("string");
-#ifdef GLIBMM_PROPERTIES_ENABLED
refTag->property_foreground() = "RosyBrown";
refTag->property_weight() = Pango::WEIGHT_BOLD;
-#else
- refTag->set_property("foreground", Glib::ustring("RosyBrown"));
- refTag->set_property("weight", Pango::WEIGHT_BOLD);
-#endif
refTag = m_refTextBuffer->create_tag("control");
-#ifdef GLIBMM_PROPERTIES_ENABLED
refTag->property_foreground() = "purple";
-#else
- refTag->set_property("foreground", Glib::ustring("purple"));
-#endif
refTag = m_refTextBuffer->create_tag("preprocessor");
-#ifdef GLIBMM_PROPERTIES_ENABLED
refTag->property_style() = Pango::STYLE_OBLIQUE;
refTag->property_foreground() = "burlywood4";
-#else
- refTag->set_property("style", Pango::STYLE_OBLIQUE);
- refTag->set_property("foreground", Glib::ustring("burlywood4"));
-#endif
refTag = m_refTextBuffer->create_tag("function");
-#ifdef GLIBMM_PROPERTIES_ENABLED
refTag->property_weight() = Pango::WEIGHT_BOLD;
refTag->property_foreground() = "DarkGoldenrod4";
-#else
- refTag->set_property("weight", Pango::WEIGHT_BOLD);
- refTag->set_property("foreground", Glib::ustring("DarkGoldenrod4"));
-#endif
}
else
{
@@ -105,11 +78,7 @@ TextWidget::TextWidget(bool is_source)
m_TextView.set_pixels_below_lines(2);
Glib::RefPtr<Gtk::TextBuffer::Tag> refTag = m_refTextBuffer->create_tag("title");
-#ifdef GLIBMM_PROPERTIES_ENABLED
refTag->property_font() = "Sans 18";
-#else
- refTag->set_property("font", Glib::ustring("Sans 18"));
-#endif
}
}
diff --git a/demos/pixbuf-demo.cc b/demos/pixbuf-demo.cc
index 279e603..5db9244 100644
--- a/demos/pixbuf-demo.cc
+++ b/demos/pixbuf-demo.cc
@@ -86,13 +86,7 @@ private:
Glib::RefPtr<Gdk::Pixbuf> create_pixbuf(const std::string& name)
{
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
return Gdk::Pixbuf::create_from_file(name);
-#else
- // Ignore this; it's broken by design.
- std::auto_ptr<Glib::Error> error;
- return Gdk::Pixbuf::create_from_file(name, error);
-#endif
}
/*
@@ -104,13 +98,7 @@ DemoRenderArea::DemoRenderArea()
:
frame_num_ (0)
{
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
background_ = Gdk::Pixbuf::create_from_file(background_name);
-#else
- // Ignore this; it's broken by design.
- std::auto_ptr<Glib::Error> error;
- background_ = Gdk::Pixbuf::create_from_file(background_name, error);
-#endif
std::transform(
&image_names[0], &image_names[G_N_ELEMENTS(image_names)],
std::back_inserter(images_),
@@ -210,9 +198,7 @@ void DemoRenderArea::generate_next_frame()
int main(int argc, char** argv)
{
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
try
-#endif
{
Gtk::Main main_instance (&argc, &argv);
@@ -224,13 +210,11 @@ int main(int argc, char** argv)
Gtk::Main::run(window);
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
catch(const Glib::Error& error)
{
std::cerr << error.what() << std::endl;
return EXIT_FAILURE;
}
-#endif
return EXIT_SUCCESS;
}
diff --git a/gdk/src/image.hg b/gdk/src/image.hg
index 117736d..2ba3800 100644
--- a/gdk/src/image.hg
+++ b/gdk/src/image.hg
@@ -28,7 +28,6 @@
_DEFS(gdkmm,gdk)
_PINCLUDE(glibmm/private/object_p.h)
-
namespace Gdk
{
@@ -57,7 +56,7 @@ protected:
*/
Image(ImageType type, const Glib::RefPtr<Visual>& visual, int width, int height);
_IGNORE(gdk_image_new)
-
+
public:
_WRAP_CREATE(ImageType type, const Glib::RefPtr<Visual>& visual, int width, int height)
@@ -69,7 +68,7 @@ public:
_WRAP_METHOD(void set_colormap(const Glib::RefPtr<Colormap>& colormap), gdk_image_set_colormap)
_WRAP_METHOD(Glib::RefPtr<Colormap> get_colormap(), gdk_image_get_colormap, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Colormap> get_colormap() const, gdk_image_get_colormap, refreturn, constversion)
-
+
_MEMBER_GET(image_type, type, ImageType, GdkImageType)
_MEMBER_GET_GOBJECT(visual, visual, Visual, GdkVisual*)
_MEMBER_GET(byte_order, byte_order, ByteOrder, GdkByteOrder)
@@ -87,4 +86,3 @@ public:
};
} /* namespace Gdk */
-
diff --git a/gdk/src/pixbuf.ccg b/gdk/src/pixbuf.ccg
index 575a648..946d600 100644
--- a/gdk/src/pixbuf.ccg
+++ b/gdk/src/pixbuf.ccg
@@ -30,18 +30,14 @@ static void pixbuf_destroy_data_callback(guint8* pixels, void* user_data)
Gdk::Pixbuf::SlotDestroyData *const slot = static_cast<Gdk::Pixbuf::SlotDestroyData*>(user_data);
g_return_if_fail(slot != 0);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
(*slot)(pixels); // invoke callback
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
delete slot;
}
@@ -153,42 +149,24 @@ Glib::RefPtr<Pixbuf> Pixbuf::create_from_data(const guint8* data, Colorspace col
return Glib::wrap(pixbuf);
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::RefPtr<Pixbuf> Pixbuf::create_from_stream(const Glib::RefPtr<Gio::InputStream>& stream)
-#else
-Glib::RefPtr<Pixbuf> Pixbuf::create_from_stream(const Glib::RefPtr<Gio::InputStream>& stream, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
GError* gerror = 0;
Glib::RefPtr<Pixbuf> retvalue = Glib::wrap(gdk_pixbuf_new_from_stream(const_cast<GInputStream*>(Glib::unwrap(stream)), 0, &(gerror)));
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
::Glib::Error::throw_exception(gerror);
-#else
- if(gerror)
- error = ::Glib::Error::throw_exception(gerror);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
return retvalue;
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::RefPtr<Pixbuf> Pixbuf::create_from_stream_at_scale(const Glib::RefPtr<Gio::InputStream>& stream, int width, int height, bool preserve_aspect_ratio)
-#else
-Glib::RefPtr<Pixbuf> Pixbuf::create_from_stream_at_scale(const Glib::RefPtr<Gio::InputStream>& stream, int width, int height, bool preserve_aspect_ratio, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
GError* gerror = 0;
Glib::RefPtr<Pixbuf> retvalue = Glib::wrap(gdk_pixbuf_new_from_stream_at_scale(const_cast<GInputStream*>(Glib::unwrap(stream)), width, height, static_cast<int>(preserve_aspect_ratio), 0, &(gerror)));
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
::Glib::Error::throw_exception(gerror);
-#else
- if(gerror)
- error = ::Glib::Error::throw_exception(gerror);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
return retvalue;
}
@@ -222,34 +200,19 @@ void Pixbuf::render_pixmap_and_mask(Glib::RefPtr<Pixmap>& pixmap_return,
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
void Pixbuf::save(const std::string& filename, const Glib::ustring& type)
-#else
-void Pixbuf::save(const std::string& filename, const Glib::ustring& type, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
GError* gerror = 0;
gdk_pixbuf_savev(gobj(), filename.c_str(), type.c_str(), 0, 0, &gerror);
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
::Glib::Error::throw_exception(gerror);
-#else
- if(gerror)
- error = ::Glib::Error::throw_exception(gerror);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
void Pixbuf::save(const std::string& filename, const Glib::ustring& type,
const Glib::StringArrayHandle& option_keys,
const Glib::StringArrayHandle& option_values)
-#else
-void Pixbuf::save(const std::string& filename, const Glib::ustring& type,
- const Glib::StringArrayHandle& option_keys,
- const Glib::StringArrayHandle& option_values, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
GError* gerror = 0;
@@ -258,23 +221,13 @@ void Pixbuf::save(const std::string& filename, const Glib::ustring& type,
const_cast<char**>(option_keys.data()), const_cast<char**>(option_values.data()),
&gerror);
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
::Glib::Error::throw_exception(gerror);
-#else
- if(gerror)
- error = ::Glib::Error::throw_exception(gerror);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
void Pixbuf::save_to_buffer(gchar*& buffer, gsize& buffer_size,
const Glib::ustring& type)
-#else
-void Pixbuf::save_to_buffer(gchar*& buffer, gsize& buffer_size,
- const Glib::ustring& type, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
GError* gerror = 0;
@@ -283,26 +236,14 @@ void Pixbuf::save_to_buffer(gchar*& buffer, gsize& buffer_size,
type.c_str(),
&gerror, NULL);
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
::Glib::Error::throw_exception(gerror);
-#else
- if(gerror)
- error = ::Glib::Error::throw_exception(gerror);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
void Pixbuf::save_to_buffer(gchar*& buffer, gsize& buffer_size,
const Glib::ustring& type,
const Glib::StringArrayHandle& option_keys,
const Glib::StringArrayHandle& option_values)
-#else
-void Pixbuf::save_to_buffer(gchar*& buffer, gsize& buffer_size,
- const Glib::ustring& type,
- const Glib::StringArrayHandle& option_keys,
- const Glib::StringArrayHandle& option_values, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
GError* gerror = 0;
@@ -312,13 +253,8 @@ void Pixbuf::save_to_buffer(gchar*& buffer, gsize& buffer_size,
const_cast<char**>(option_keys.data()), const_cast<char**>(option_values.data()),
&gerror);
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
::Glib::Error::throw_exception(gerror);
-#else
- if(gerror)
- error = ::Glib::Error::throw_exception(gerror);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
}
Pixbuf::SListHandle_PixbufFormat Pixbuf::get_formats()
diff --git a/gdk/src/pixbuf.hg b/gdk/src/pixbuf.hg
index 2fcf2ef..c45d236 100644
--- a/gdk/src/pixbuf.hg
+++ b/gdk/src/pixbuf.hg
@@ -389,18 +389,10 @@ public:
bool copy_pixels = false), gdk_pixbuf_new_from_inline, errthrow)
_WRAP_METHOD(static Glib::RefPtr<Pixbuf> create_from_stream(const Glib::RefPtr<Gio::InputStream>& stream, const Glib::RefPtr<Gio::Cancellable>& cancelable), gdk_pixbuf_new_from_stream, errthrow)
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<Pixbuf> create_from_stream(const Glib::RefPtr<Gio::InputStream>& stream);
-#else
- static Glib::RefPtr<Pixbuf> create_from_stream(const Glib::RefPtr<Gio::InputStream>& stream, std::auto_ptr<Glib::Error>& error);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
_WRAP_METHOD(static Glib::RefPtr<Pixbuf> create_from_stream_at_scale(const Glib::RefPtr<Gio::InputStream>& stream, int width, int height, bool preserve_aspect_ratio, const Glib::RefPtr<Gio::Cancellable>& cancelable), gdk_pixbuf_new_from_stream_at_scale, errthrow)
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<Pixbuf> create_from_stream_at_scale(const Glib::RefPtr<Gio::InputStream>& stream, int width, int height, bool preserve_aspect_ratio);
-#else
- static Glib::RefPtr<Pixbuf> create_from_stream_at_scale(const Glib::RefPtr<Gio::InputStream>& stream, int width, int height, bool preserve_aspect_ratio, std::auto_ptr<Glib::Error>& error);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
_WRAP_METHOD(Colorspace get_colorspace() const, gdk_pixbuf_get_colorspace)
@@ -426,11 +418,7 @@ public:
* @throw Glib::FileError
* @throw Gdk::PixbufError
*/
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
void save(const std::string& filename, const Glib::ustring& type);
- #else
- void save(const std::string& filename, const Glib::ustring& type, std::auto_ptr<Glib::Error>& error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
_IGNORE(gdk_pixbuf_save)
/** Saves pixbuf to a file in format @a type.
@@ -455,15 +443,9 @@ public:
* @throw Glib::FileError
* @throw Gdk::PixbufError
*/
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
void save(const std::string& filename, const Glib::ustring& type,
const Glib::StringArrayHandle& option_keys,
const Glib::StringArrayHandle& option_values);
- #else
- void save(const std::string& filename, const Glib::ustring& type,
- const Glib::StringArrayHandle& option_keys,
- const Glib::StringArrayHandle& option_values, std::auto_ptr<Glib::Error>& error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
_IGNORE(gdk_pixbuf_savev)
@@ -502,13 +484,8 @@ gboolean gdk_pixbuf_save_to_callbackv (GdkPixbuf *pixbuf,
* @throw Glib::FileError
* @throw Gdk::PixbufError
*/
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
void save_to_buffer(gchar*& buffer, gsize& buffer_size,
const Glib::ustring& type = "png");
- #else
- void save_to_buffer(gchar*& buffer, gsize& buffer_size,
- const Glib::ustring& type, std::auto_ptr<Glib::Error>& error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
/* Saves the pixbuf to a new buffer in format @a type.
* Note that the buffer is not nul-terminated and may contain embedded nulls.
@@ -521,17 +498,10 @@ gboolean gdk_pixbuf_save_to_callbackv (GdkPixbuf *pixbuf,
* @throw Glib::FileError
* @throw Gdk::PixbufError
*/
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
void save_to_buffer(gchar*& buffer, gsize& buffer_size,
const Glib::ustring& type,
const Glib::StringArrayHandle& option_keys,
const Glib::StringArrayHandle& option_values);
- #else
- void save_to_buffer(gchar*& buffer, gsize& buffer_size,
- const Glib::ustring& type,
- const Glib::StringArrayHandle& option_keys,
- const Glib::StringArrayHandle& option_values, std::auto_ptr<Glib::Error>& error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
_IGNORE(gdk_pixbuf_save_to_bufferv, gdk_pixbuf_save_to_buffer)
diff --git a/gdk/src/pixbufanimation.ccg b/gdk/src/pixbufanimation.ccg
index 28207f8..91ca212 100644
--- a/gdk/src/pixbufanimation.ccg
+++ b/gdk/src/pixbufanimation.ccg
@@ -25,22 +25,13 @@
namespace Gdk
{
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::RefPtr<PixbufAnimation> PixbufAnimation::create_from_file(const Glib::ustring& filename)
-#else
-Glib::RefPtr<PixbufAnimation> PixbufAnimation::create_from_file(const Glib::ustring& filename, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
GError* gerror = 0;
return Glib::wrap(gdk_pixbuf_animation_new_from_file(filename.c_str(), &gerror));
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
::Glib::Error::throw_exception(gerror);
-#else
- if(gerror)
- error = ::Glib::Error::throw_exception(gerror);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
}
} //Gdk
diff --git a/gdk/src/pixbufanimation.hg b/gdk/src/pixbufanimation.hg
index 977e845..b1b80bb 100644
--- a/gdk/src/pixbufanimation.hg
+++ b/gdk/src/pixbufanimation.hg
@@ -46,11 +46,7 @@ protected:
public:
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<PixbufAnimation> create_from_file(const Glib::ustring& filename);
- #else
- static Glib::RefPtr<PixbufAnimation> create_from_file(const Glib::ustring& filename, std::auto_ptr<Glib::Error>& error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
_WRAP_METHOD(int get_width() const, gdk_pixbuf_animation_get_width)
_WRAP_METHOD(int get_height() const, gdk_pixbuf_animation_get_height)
diff --git a/gtk/gtkmm/cellrenderer_generation.cc b/gtk/gtkmm/cellrenderer_generation.cc
index 201a711..841613f 100644
--- a/gtk/gtkmm/cellrenderer_generation.cc
+++ b/gtk/gtkmm/cellrenderer_generation.cc
@@ -41,11 +41,7 @@ CellRenderer* generate_cellrenderer<bool>(bool editable)
CellRendererToggle* pCellRenderer = new CellRendererToggle();
//GTK+'s "activatable" really means "editable":
-#ifdef GLIBMM_PROPERTIES_ENABLED
pCellRenderer->property_activatable() = editable;
-#else
- pCellRenderer->set_property("activatable", editable);
-#endif //GLIBMM_PROPERTIES_ENABLED
return pCellRenderer;
}
@@ -56,11 +52,7 @@ CellRenderer* generate_cellrenderer<AccelKey>(bool editable)
CellRendererAccel* pCellRenderer = new CellRendererAccel();
//GTK+'s "editable" really means "editable":
-#ifdef GLIBMM_PROPERTIES_ENABLED
pCellRenderer->property_editable() = editable;
-#else
- pCellRenderer->set_property("editable", editable);
-#endif //GLIBMM_PROPERTIES_ENABLED
return pCellRenderer;
}
diff --git a/gtk/gtkmm/cellrenderer_generation.h b/gtk/gtkmm/cellrenderer_generation.h
index 747809f..d7c90eb 100644
--- a/gtk/gtkmm/cellrenderer_generation.h
+++ b/gtk/gtkmm/cellrenderer_generation.h
@@ -39,11 +39,7 @@ CellRenderer* generate_cellrenderer(bool editable = false)
CellRendererText* pCellRenderer = new CellRendererText(); //the default - template specializations will use other renderers.
//CellRendererText can render both strings and numerical values.
-#ifdef GLIBMM_PROPERTIES_ENABLED
pCellRenderer->property_editable() = editable;
-#else
- pCellRenderer->set_property("editable", editable);
-#endif
return pCellRenderer;
}
diff --git a/gtk/gtkmm/treeview_private.cc b/gtk/gtkmm/treeview_private.cc
index 720bfb1..46d4ab7 100644
--- a/gtk/gtkmm/treeview_private.cc
+++ b/gtk/gtkmm/treeview_private.cc
@@ -35,10 +35,8 @@ void SignalProxy_CellData_gtk_callback(GtkTreeViewColumn*, GtkCellRenderer* cell
TreeViewColumn::SlotCellData* the_slot = static_cast<TreeViewColumn::SlotCellData*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLE
// use Slot::operator()
Gtk::TreeModel::iterator cppiter = TreeIter(model, iter);
if(!cppiter->get_model_gobject())
@@ -48,13 +46,11 @@ void SignalProxy_CellData_gtk_callback(GtkTreeViewColumn*, GtkCellRenderer* cell
}
(*the_slot)(Glib::wrap(cell, false), cppiter);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLE
}
void SignalProxy_CellData_gtk_callback_destroy(void* data)
@@ -67,12 +63,9 @@ gboolean SignalProxy_RowSeparator_gtk_callback(GtkTreeModel* model, GtkTreeIter*
{
TreeView::SlotRowSeparator* the_slot = static_cast<TreeView::SlotRowSeparator*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLE
return (*the_slot)(Glib::wrap(model, true), Gtk::TreeIter(model, iter));
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
@@ -80,7 +73,6 @@ gboolean SignalProxy_RowSeparator_gtk_callback(GtkTreeModel* model, GtkTreeIter*
}
return 0; // arbitrary value
- #endif //GLIBMM_EXCEPTIONS_ENABLE
}
void SignalProxy_RowSeparator_gtk_callback_destroy(void* data)
diff --git a/gtk/src/aboutdialog.ccg b/gtk/src/aboutdialog.ccg
index 96a9d33..2d962e5 100644
--- a/gtk/src/aboutdialog.ccg
+++ b/gtk/src/aboutdialog.ccg
@@ -28,19 +28,15 @@ static void SignalProxy_ActivateLink_gtk_callback(GtkAboutDialog* about, const g
{
Gtk::AboutDialog::SlotActivateLink* the_slot = static_cast<Gtk::AboutDialog::SlotActivateLink*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
Gtk::AboutDialog* pCppAbout = Glib::wrap(about);
(*the_slot)( *pCppAbout, Glib::convert_const_gchar_ptr_to_ustring(link) );
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static void SignalProxy_ActivateLink_gtk_callback_destroy(void* data)
diff --git a/gtk/src/assistant.ccg b/gtk/src/assistant.ccg
index e417540..917b5c9 100644
--- a/gtk/src/assistant.ccg
+++ b/gtk/src/assistant.ccg
@@ -28,19 +28,15 @@ static gint SignalProxy_SlotForwardPage_gtk_callback(gint current_page, gpointer
{
Gtk::Assistant::SlotForwardPage* the_slot = static_cast<Gtk::Assistant::SlotForwardPage*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return (*the_slot)(current_page);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
return gint();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static void SignalProxy_SlotForwardPage_gtk_callback_destroy(void* data)
diff --git a/gtk/src/builder.ccg b/gtk/src/builder.ccg
index 420f3d0..0c2867a 100644
--- a/gtk/src/builder.ccg
+++ b/gtk/src/builder.ccg
@@ -20,7 +20,6 @@
#include <gtk/gtk.h>
-#ifdef GLIBMM_VFUNCS_ENABLED
// Allow GtkBuilder to instantiate a gtkmm derived GType instead of the regular
// GTK+ GType, so we can, for instance, use our vfuncs and default signal handlers.
static GType
@@ -43,12 +42,10 @@ get_type_from_name_vfunc_callback(GtkBuilder*, const char* type_name)
return gtype;
}
-#endif /* !GLIBMM_VFUNCS_ENABLED */
namespace Gtk
{
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
// static
Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename)
{
@@ -58,19 +55,7 @@ Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename)
else
return Glib::RefPtr<Builder>();
}
-#else
-Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename,
- std::auto_ptr<Glib::Error>& error)
-{
- Glib::RefPtr<Builder> builder = Builder::create();
- if(builder->add_from_file(filename, error))
- return builder;
- else
- return Glib::RefPtr<Builder>();
-}
-#endif /* !GLIBMM_EXCEPTIONS_ENABLED */
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
// static
Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename, const char* object_id)
{
@@ -80,18 +65,7 @@ Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename, con
else
return Glib::RefPtr<Builder>();
}
-#else
-Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename, const char* object_id, std::auto_ptr<Glib::Error>& error)
-{
- Glib::RefPtr<Builder> builder = Builder::create();
- if(builder->add_from_file(filename, object_id, error))
- return builder;
- else
- return Glib::RefPtr<Builder>();
-}
-#endif
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
//static
Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename, const Glib::ustring& object_id)
{
@@ -101,18 +75,7 @@ Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename, con
else
return Glib::RefPtr<Builder>();
}
-#else
-Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename, const Glib::ustring& object_id, std::auto_ptr<Glib::Error>& error)
-{
- Glib::RefPtr<Builder> builder = Builder::create();
- if(builder->add_from_file(filename, object_id, error))
- return builder;
- else
- return Glib::RefPtr<Builder>();
-}
-#endif
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
//static
Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename, const Glib::StringArrayHandle& object_ids)
{
@@ -122,18 +85,7 @@ Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename, con
else
return Glib::RefPtr<Builder>();
}
-#else
-Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename, const Glib::StringArrayHandle& object_ids, std::auto_ptr<Glib::Error>& error)
-{
- Glib::RefPtr<Builder> builder = Builder::create();
- if(builder->add_from_file(filename, object_ids, error))
- return builder;
- else
- return Glib::RefPtr<Builder>();
-}
-#endif
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
//static
Glib::RefPtr<Builder> Builder::create_from_string(const Glib::ustring& buffer)
{
@@ -143,19 +95,7 @@ Glib::RefPtr<Builder> Builder::create_from_string(const Glib::ustring& buffer)
else
return Glib::RefPtr<Builder>();
}
-#else
-Glib::RefPtr<Builder> Builder::create_from_string(const Glib::ustring& buffer,
- std::auto_ptr<Glib::Error>& error)
-{
- Glib::RefPtr<Builder> builder = Builder::create();
- if(builder->add_from_string(buffer, error))
- return builder;
- else
- return Glib::RefPtr<Builder>();
-}
-#endif /* !GLIBMM_EXCEPTIONS_ENABLED */
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
//static
Glib::RefPtr<Builder> Builder::create_from_string(const Glib::ustring& buffer,
const char* object_id)
@@ -166,20 +106,7 @@ Glib::RefPtr<Builder> Builder::create_from_string(const Glib::ustring& buffer,
else
return Glib::RefPtr<Builder>();
}
-#else
-Glib::RefPtr<Builder> Builder::create_from_string(const Glib::ustring& buffer,
- const char* object_id,
- std::auto_ptr<Glib::Error>& error)
-{
- Glib::RefPtr<Builder> builder = Builder::create();
- if(builder->add_from_string(buffer, object_id, error))
- return builder;
- else
- return Glib::RefPtr<Builder>();
-}
-#endif /* !GLIBMM_EXCEPTIONS_ENABLED */
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
//static
Glib::RefPtr<Builder> Builder::create_from_string(const Glib::ustring& buffer,
const Glib::ustring& object_id)
@@ -190,20 +117,7 @@ Glib::RefPtr<Builder> Builder::create_from_string(const Glib::ustring& buffer,
else
return Glib::RefPtr<Builder>();
}
-#else
-Glib::RefPtr<Builder> Builder::create_from_string(const Glib::ustring& buffer,
- const Glib::ustring& object_id,
- std::auto_ptr<Glib::Error>& error)
-{
- Glib::RefPtr<Builder> builder = Builder::create();
- if(builder->add_from_string(buffer, object_id, error))
- return builder;
- else
- return Glib::RefPtr<Builder>();
-}
-#endif /* !GLIBMM_EXCEPTIONS_ENABLED */
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
//static
Glib::RefPtr<Builder> Builder::create_from_string(const Glib::ustring& buffer,
const Glib::StringArrayHandle& object_ids)
@@ -214,119 +128,57 @@ Glib::RefPtr<Builder> Builder::create_from_string(const Glib::ustring& buffer,
else
return Glib::RefPtr<Builder>();
}
-#else
-Glib::RefPtr<Builder> Builder::create_from_string(const Glib::ustring& buffer,
- const Glib::StringArrayHandle& object_ids,
- std::auto_ptr<Glib::Error>& error)
-{
- Glib::RefPtr<Builder> builder = Builder::create();
- if(builder->add_from_string(buffer, object_ids, error))
- return builder;
- else
- return Glib::RefPtr<Builder>();
-}
-#endif /* !GLIBMM_EXCEPTIONS_ENABLED */
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
bool Builder::add_from_file(const std::string& filename, const char* object_id)
-#else
-bool Builder::add_from_file(const std::string& filename, const char* object_id, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
std::list<Glib::ustring> object_ids;
object_ids.push_back(object_id);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
return add_from_file(filename, object_ids);
- #else
- return add_from_file(filename, object_ids, error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
bool Builder::add_from_file(const std::string& filename, const Glib::ustring& object_id)
-#else
-bool Builder::add_from_file(const std::string& filename, const Glib::ustring& object_id, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
std::list<Glib::ustring> object_ids;
object_ids.push_back(object_id);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
return add_from_file(filename, object_ids);
- #else
- return add_from_file(filename, object_ids, error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
bool Builder::add_from_string(const Glib::ustring& buffer)
-#else
-bool Builder::add_from_string(const Glib::ustring& buffer, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
GError* gerror = 0;
bool retvalue = gtk_builder_add_from_string(gobj(), buffer.c_str(), -1 /* means null-terminated */, &(gerror));
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
::Glib::Error::throw_exception(gerror);
-#else
- if(gerror)
- error = ::Glib::Error::throw_exception(gerror);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
return retvalue;
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
bool Builder::add_from_string(const Glib::ustring& buffer, const char* object_id)
-#else
-bool Builder::add_from_string(const Glib::ustring& buffer, const char* object_id, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
std::list<Glib::ustring> object_ids;
object_ids.push_back(object_id);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
return add_from_string(buffer, object_ids);
- #else
- return add_from_string(buffer, object_ids, error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
bool Builder::add_from_string(const Glib::ustring& buffer, const Glib::ustring& object_id)
-#else
-bool Builder::add_from_string(const Glib::ustring& buffer, const Glib::ustring& object_id, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
std::list<Glib::ustring> object_ids;
object_ids.push_back(object_id);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
return add_from_string(buffer, object_ids);
- #else
- return add_from_string(buffer, object_ids, error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
bool Builder::add_from_string(const Glib::ustring& buffer, const Glib::StringArrayHandle& object_ids)
-#else
-bool Builder::add_from_string(const Glib::ustring& buffer, const Glib::StringArrayHandle& object_ids, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
GError* gerror = 0;
bool retvalue = gtk_builder_add_objects_from_string(gobj(), buffer.c_str(), -1 /* means null-terminated */, const_cast<char**>(object_ids.data()), &(gerror));
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
::Glib::Error::throw_exception(gerror);
-#else
- if(gerror)
- error = ::Glib::Error::throw_exception(gerror);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
return retvalue;
}
diff --git a/gtk/src/builder.hg b/gtk/src/builder.hg
index e13212c..a227952 100644
--- a/gtk/src/builder.hg
+++ b/gtk/src/builder.hg
@@ -60,12 +60,7 @@ public:
*
* @newin{2,12}
*/
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<Builder> create_from_file(const std::string& filename);
-#else
- static Glib::RefPtr<Builder> create_from_file(const std::string& filename,
- std::auto_ptr<Glib::Error>& error);
-#endif
/** Parses a file containing a GtkBuilder UI definition, building only the requested object.
*
@@ -80,11 +75,7 @@ public:
*
* @newin{2,14}
*/
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<Builder> create_from_file(const std::string& filename, const Glib::ustring& object_id);
-#else
- static Glib::RefPtr<Builder> create_from_file(const std::string& filename, const Glib::ustring& object_id, std::auto_ptr<Glib::Error>& error);
-#endif
//This is just to avoid the ambiguous call when using a string literal,
//caused by the overload that takes a StringArrayHandle.
/** Parses a file containing a GtkBuilder UI definition, building only the requested object.
@@ -100,11 +91,7 @@ public:
*
* @newin{2,16}
*/
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<Builder> create_from_file(const std::string& filename, const char* object_id);
-#else
- static Glib::RefPtr<Builder> create_from_file(const std::string& filename, const char* object_id, std::auto_ptr<Glib::Error>& error);
-#endif
/** Parses a file containing a GtkBuilder UI definition, building only the requested objects.
*
* If you are adding an object that depends on an object that is not
@@ -118,11 +105,7 @@ public:
*
* @newin{2,14}
*/
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<Builder> create_from_file(const std::string& filename, const Glib::StringArrayHandle& object_ids);
-#else
- static Glib::RefPtr<Builder> create_from_file(const std::string& filename, const Glib::StringArrayHandle& object_ids, std::auto_ptr<Glib::Error>& error);
-#endif
/** Parses a string containing a GtkBuilder UI definition.
*
@@ -132,12 +115,7 @@ public:
*
* @newin{2,12}
*/
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<Builder> create_from_string(const Glib::ustring& buffer);
-#else
- static Glib::RefPtr<Builder> create_from_string(const Glib::ustring& buffer,
- std::auto_ptr<Glib::Error>& error);
-#endif
//This is just to avoid the ambiguous call when using a string literal,
//caused by the overload that takes a StringArrayHandle.
/** Parses a string containing a GtkBuilder UI definition building only the requested object.
@@ -149,11 +127,7 @@ public:
*
* @newin{2,16}
*/
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<Builder> create_from_string(const Glib::ustring& buffer, const char* object_id);
-#else
- static Glib::RefPtr<Builder> create_from_string(const Glib::ustring& buffer, const char* object_id, std::auto_ptr<Glib::Error>& error);
-#endif /* !GLIBMM_EXCEPTIONS_ENABLED */
/** Parses a string containing a GtkBuilder UI definition building only the requested object.
*
@@ -164,11 +138,7 @@ public:
*
* @newin{2,14}
*/
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<Builder> create_from_string(const Glib::ustring& buffer, const Glib::ustring& object_id);
-#else
- static Glib::RefPtr<Builder> create_from_string(const Glib::ustring& buffer, const Glib::ustring& object_id, std::auto_ptr<Glib::Error>& error);
-#endif /* !GLIBMM_EXCEPTIONS_ENABLED */
/** Parses a string containing a GtkBuilder UI definition building only the requested objects.
*
@@ -183,11 +153,7 @@ public:
*
* @newin{2,14}
*/
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<Builder> create_from_string(const Glib::ustring& buffer, const Glib::StringArrayHandle& object_ids);
-#else
- static Glib::RefPtr<Builder> create_from_string(const Glib::ustring& buffer, const Glib::StringArrayHandle& object_ids, std::auto_ptr<Glib::Error>& error);
-#endif /* !GLIBMM_EXCEPTIONS_ENABLED */
_IGNORE(gtk_builder_add_objects_from_file)
/** Parses a file containing a GtkBuilder UI definition,
@@ -218,11 +184,7 @@ public:
*
* @newin{2,16}
*/
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
bool add_from_file(const std::string& filename, const char* object_id);
- #else
- bool add_from_file(const std::string& filename, const char* object_id, std::auto_ptr<Glib::Error>& error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
/** Parses a file containing a GtkBuilder UI definition,
* building only the requested object,
@@ -239,11 +201,7 @@ public:
*
* @newin{2,14}
*/
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
bool add_from_file(const std::string& filename, const Glib::ustring& object_id);
- #else
- bool add_from_file(const std::string& filename, const Glib::ustring& object_id, std::auto_ptr<Glib::Error>& error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
#m4 _CONVERSION(`const Glib::StringArrayHandle&',`gchar**',`const_cast<char**>(($3).data())')
_WRAP_METHOD(bool add_from_file(const std::string& filename, const Glib::StringArrayHandle& object_ids), gtk_builder_add_objects_from_file, errthrow)
@@ -259,11 +217,7 @@ public:
*
* @newin{2,12}
*/
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
bool add_from_string(const Glib::ustring& buffer);
- #else
- bool add_from_string(const Glib::ustring& buffer, std::auto_ptr<Glib::Error>& error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
/** Parses a string containing a GtkBuilder UI definition,
* building only the requested object,
@@ -276,11 +230,7 @@ public:
*
* @newin{2,16}
*/
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
bool add_from_string(const Glib::ustring& buffer, const char* object_id);
- #else
- bool add_from_string(const Glib::ustring& buffer, const char* object_id, std::auto_ptr<Glib::Error>& error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
/** Parses a string containing a GtkBuilder UI definition,
* building only the requested object,
@@ -293,11 +243,7 @@ public:
*
* @newin{2,14}
*/
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
bool add_from_string(const Glib::ustring& buffer, const Glib::ustring& object_id);
- #else
- bool add_from_string(const Glib::ustring& buffer, const Glib::ustring& object_id, std::auto_ptr<Glib::Error>& error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
/** Parses a string containing a GtkBuilder UI definition,
* building only the requested objects,
@@ -310,11 +256,7 @@ public:
*
* @newin{2,14}
*/
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
bool add_from_string(const Glib::ustring& buffer, const Glib::StringArrayHandle& object_ids);
- #else
- bool add_from_string(const Glib::ustring& buffer, const Glib::StringArrayHandle& object_ids, std::auto_ptr<Glib::Error>& error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
_IGNORE(gtk_builder_add_objects_from_string)
/** Parses a string containing a GtkBuilder UI definition
diff --git a/gtk/src/calendar.ccg b/gtk/src/calendar.ccg
index e588b9a..1bd2cb6 100644
--- a/gtk/src/calendar.ccg
+++ b/gtk/src/calendar.ccg
@@ -31,20 +31,16 @@ static gchar* SignalProxy_Details_gtk_callback(GtkCalendar*, guint year, guint m
{
Gtk::Calendar::SlotDetails* the_slot = static_cast<Gtk::Calendar::SlotDetails*>(user_data);
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
try
-#endif
{
const Glib::ustring temp = (*the_slot)(year, month, day);
return g_strdup(temp.c_str()); //Freed by GtkCalendar.
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
catch(...)
{
Glib::exception_handlers_invoke();
}
return 0; // arbitrary value
-#endif
}
static void SignalProxy_Details_gtk_callback_destroy(void* data)
diff --git a/gtk/src/celllayout.ccg b/gtk/src/celllayout.ccg
index 5ea3f88..65d77b9 100644
--- a/gtk/src/celllayout.ccg
+++ b/gtk/src/celllayout.ccg
@@ -25,20 +25,16 @@ static void SignalProxy_CellData_gtk_callback(GtkCellLayout* /* cell_layout */,
{
Gtk::CellLayout::SlotCellData* the_slot = static_cast<Gtk::CellLayout::SlotCellData*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
//We ignore the cell, because that was given as an argument to the connecting method, so the caller should know which one it is already.
//And we ignore the tree_model because that can be obtained from the iter or from the CellLayout itself.
(*the_slot)(Gtk::TreeModel::const_iterator(tree_model, iter));
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static void SignalProxy_CellData_gtk_callback_destroy(void* data)
@@ -49,13 +45,11 @@ static void SignalProxy_CellData_gtk_callback_destroy(void* data)
namespace Gtk
{
-#ifdef GLIBMM_PROPERTIES_ENABLED
void CellLayout::add_attribute(const Glib::PropertyProxy_Base& property, const TreeModelColumnBase& column)
{
gtk_cell_layout_add_attribute(gobj(),
(GtkCellRenderer*) property.get_object()->gobj(), property.get_name(), column.index());
}
-#endif //GLIBMM_PROPERTIES_ENABLED
void CellLayout::add_attribute(CellRenderer& cell, const Glib::ustring& attribute, const TreeModelColumnBase& column)
{
diff --git a/gtk/src/celllayout.hg b/gtk/src/celllayout.hg
index d796c33..755cfb5 100644
--- a/gtk/src/celllayout.hg
+++ b/gtk/src/celllayout.hg
@@ -36,7 +36,7 @@ namespace Gtk
{
/** An interface for packing cells.
- * CellLayout is an interface to be implemented by all objects which want to provide a TreeView::Column-like API
+ * CellLayout is an interface to be implemented by all objects which want to provide a TreeView::Column-like API
* for packing cells, setting attributes and data funcs.
*/
class CellLayout : public Glib::Interface
@@ -63,9 +63,7 @@ public:
_WRAP_METHOD(void add_attribute(CellRenderer& cell, const Glib::ustring& attribute, int column), gtk_cell_layout_add_attribute)
-#ifdef GLIBMM_PROPERTIES_ENABLED
void add_attribute(const Glib::PropertyProxy_Base& property, const TreeModelColumnBase& column);
-#endif
void add_attribute(CellRenderer& cell, const Glib::ustring& attribute, const TreeModelColumnBase& column);
@@ -103,12 +101,7 @@ void CellLayout::pack_start(const TreeModelColumn<T_ModelColumnType>& column, bo
pack_start(*pCellRenderer, expand);
//Make the renderer render the column:
-#ifdef GLIBMM_PROPERTIES_ENABLED
add_attribute(pCellRenderer->_property_renderable(), column);
-#else
- add_attribute(*pCellRenderer, pCellRenderer->_property_renderable(), column);
-#endif
}
} // namespace Gtk
-
diff --git a/gtk/src/cellrenderer.ccg b/gtk/src/cellrenderer.ccg
index bc6de61..eb2e408 100644
--- a/gtk/src/cellrenderer.ccg
+++ b/gtk/src/cellrenderer.ccg
@@ -28,19 +28,11 @@ void CellRenderer::get_size(Widget& widget, int& x_offset, int& y_offset, int& w
gtk_cell_renderer_get_size(const_cast<GtkCellRenderer*>(gobj()), widget.gobj(), 0, &x_offset, &y_offset, &width, &height);
}
-#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_Base CellRenderer::_property_renderable()
{
g_assert_not_reached();
return Glib::PropertyProxy<int>(0, 0); // shut up warnings
}
-#else
-Glib::ustring CellRenderer::_property_renderable()
-{
- g_assert_not_reached();
- return Glib::ustring();
-}
-#endif //GLIBMM_PROPERTIES_ENABLED
} // namespace Gtk
diff --git a/gtk/src/cellrenderer.hg b/gtk/src/cellrenderer.hg
index 8e0df05..dd38aaa 100644
--- a/gtk/src/cellrenderer.hg
+++ b/gtk/src/cellrenderer.hg
@@ -111,11 +111,7 @@ public:
* For instance, property_text for CellRendererText, and property_active for CellRendererToggle
* Needs to be overridden in derived classes.
*/
-#ifdef GLIBMM_PROPERTIES_ENABLED
virtual Glib::PropertyProxy_Base _property_renderable();
-#else
- virtual Glib::ustring _property_renderable();
-#endif
/** This signal is emitted when the user cancels the process of editing a
* cell. For example, an editable cell renderer could be written to cancel
diff --git a/gtk/src/cellrendereraccel.ccg b/gtk/src/cellrendereraccel.ccg
index 52f191c..27a25a1 100644
--- a/gtk/src/cellrendereraccel.ccg
+++ b/gtk/src/cellrendereraccel.ccg
@@ -25,12 +25,10 @@
namespace Gtk
{
-#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_Base CellRendererAccel::_property_renderable()
{
//Renderering just this one property would probably not be meaningful.
return property_accel_key();
}
-#endif //GLIBMM_PROPERTIES_ENABLED
} //namespace Gtk
diff --git a/gtk/src/cellrendereraccel.hg b/gtk/src/cellrendereraccel.hg
index 5c188c1..ab83228 100644
--- a/gtk/src/cellrendereraccel.hg
+++ b/gtk/src/cellrendereraccel.hg
@@ -57,9 +57,7 @@ public:
_WRAP_PROPERTY("accel-mods", Gdk::ModifierType)
_WRAP_PROPERTY("keycode", guint)
-#ifdef GLIBMM_PROPERTIES_ENABLED
virtual Glib::PropertyProxy_Base _property_renderable(); //override
-#endif //GLIBMM_PROPERTIES_ENABLED
};
} /* namespace Gtk */
diff --git a/gtk/src/cellrenderercombo.ccg b/gtk/src/cellrenderercombo.ccg
index 863b3b0..1b44bcc 100644
--- a/gtk/src/cellrenderercombo.ccg
+++ b/gtk/src/cellrenderercombo.ccg
@@ -36,16 +36,9 @@ static GtkTreeModel* _get_model(GtkCellRendererCombo* renderer)
namespace Gtk
{
-#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_Base CellRendererCombo::_property_renderable()
{
return CellRendererText::_property_renderable();
}
-#else
-Glib::ustring CellRendererCombo::_property_renderable()
-{
- return CellRendererText::_property_renderable();
-}
-#endif //#ifdef GLIBMM_PROPERTIES_ENABLED
} //namespace Gtk
diff --git a/gtk/src/cellrenderercombo.hg b/gtk/src/cellrenderercombo.hg
index 9590de9..913fa5f 100644
--- a/gtk/src/cellrenderercombo.hg
+++ b/gtk/src/cellrenderercombo.hg
@@ -61,11 +61,7 @@ dnl // not.
_WRAP_PROPERTY("text_column", int)
_WRAP_PROPERTY("has_entry", bool)
-#ifdef GLIBMM_PROPERTIES_ENABLED
virtual Glib::PropertyProxy_Base _property_renderable();
-#else
- virtual Glib::ustring _property_renderable();
-#endif
};
} /* namespace Gtk */
diff --git a/gtk/src/cellrendererpixbuf.ccg b/gtk/src/cellrendererpixbuf.ccg
index 08b972f..dcc35e6 100644
--- a/gtk/src/cellrendererpixbuf.ccg
+++ b/gtk/src/cellrendererpixbuf.ccg
@@ -24,16 +24,9 @@
namespace Gtk
{
-#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_Base CellRendererPixbuf::_property_renderable()
{
return property_pixbuf();
}
-#else
-Glib::ustring CellRendererPixbuf::_property_renderable()
-{
- return "pixbuf";
-}
-#endif //GLIBMM_PROPERTIES_ENABLED
} //namespace Gtk
diff --git a/gtk/src/cellrendererpixbuf.hg b/gtk/src/cellrendererpixbuf.hg
index 7a6088c..e6f9c9a 100644
--- a/gtk/src/cellrendererpixbuf.hg
+++ b/gtk/src/cellrendererpixbuf.hg
@@ -56,11 +56,7 @@ public:
_WRAP_PROPERTY("follow-state", bool)
_WRAP_PROPERTY("gicon", Glib::RefPtr<Gio::Icon>)
-#ifdef GLIBMM_PROPERTIES_ENABLED
virtual Glib::PropertyProxy_Base _property_renderable();
-#else
- virtual Glib::ustring _property_renderable();
-#endif
};
} /* namespace Gtk */
diff --git a/gtk/src/cellrendererprogress.ccg b/gtk/src/cellrendererprogress.ccg
index 440a9e3..fa72f81 100644
--- a/gtk/src/cellrendererprogress.ccg
+++ b/gtk/src/cellrendererprogress.ccg
@@ -25,17 +25,10 @@
namespace Gtk
{
-#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_Base CellRendererProgress::_property_renderable()
{
return _property_renderable();
}
-#else
-Glib::ustring CellRendererProgress::_property_renderable()
-{
- return _property_renderable();
-}
-#endif //#ifdef GLIBMM_PROPERTIES_ENABLED
} // namespace Gtk
diff --git a/gtk/src/cellrendererprogress.hg b/gtk/src/cellrendererprogress.hg
index d741bbc..2d02b6d 100644
--- a/gtk/src/cellrendererprogress.hg
+++ b/gtk/src/cellrendererprogress.hg
@@ -42,11 +42,7 @@ public:
_WRAP_PROPERTY("text-xalign", float)
_WRAP_PROPERTY("text-yalign", float)
-#ifdef GLIBMM_PROPERTIES_ENABLED
virtual Glib::PropertyProxy_Base _property_renderable();
-#else
- virtual Glib::ustring _property_renderable();
-#endif
};
} // namespace Gtk
diff --git a/gtk/src/cellrendererspin.ccg b/gtk/src/cellrendererspin.ccg
index ffe142b..c2a46a6 100644
--- a/gtk/src/cellrendererspin.ccg
+++ b/gtk/src/cellrendererspin.ccg
@@ -20,11 +20,9 @@
namespace Gtk
{
-#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_Base CellRendererSpin::_property_renderable()
{
return CellRendererText::_property_renderable();
}
-#endif //GLIBMM_PROPERTIES_ENABLED
} //namespace Gtk
diff --git a/gtk/src/cellrendererspin.hg b/gtk/src/cellrendererspin.hg
index 0bcbc5d..95c71a3 100644
--- a/gtk/src/cellrendererspin.hg
+++ b/gtk/src/cellrendererspin.hg
@@ -53,9 +53,7 @@ public:
_WRAP_PROPERTY("climb_rate", double)
_WRAP_PROPERTY("digits", guint)
-#ifdef GLIBMM_PROPERTIES_ENABLED
virtual Glib::PropertyProxy_Base _property_renderable(); //override
-#endif //GLIBMM_PROPERTIES_ENABLED
};
} // namespace Gtk
diff --git a/gtk/src/cellrenderertext.ccg b/gtk/src/cellrenderertext.ccg
index 7849529..a2d76f7 100644
--- a/gtk/src/cellrenderertext.ccg
+++ b/gtk/src/cellrenderertext.ccg
@@ -24,17 +24,10 @@
namespace Gtk
{
-#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_Base CellRendererText::_property_renderable()
{
return property_text();
}
-#else
-Glib::ustring CellRendererText::_property_renderable()
-{
- return "text";
-}
-#endif //#GLIBMM_PROPERTIES_ENABLED
void CellRendererText::edited(const Glib::ustring& path, const Glib::ustring& new_text)
{
diff --git a/gtk/src/cellrenderertext.hg b/gtk/src/cellrenderertext.hg
index a1006e0..e40c8b0 100644
--- a/gtk/src/cellrenderertext.hg
+++ b/gtk/src/cellrenderertext.hg
@@ -86,11 +86,7 @@ public:
_WRAP_PROPERTY("ellipsize-set", bool)
_WRAP_PROPERTY("single-paragraph-mode", bool)
-#ifdef GLIBMM_PROPERTIES_ENABLED
virtual Glib::PropertyProxy_Base _property_renderable();
-#else
- virtual Glib::ustring _property_renderable();
-#endif
protected:
/** Emits the "edited" signal.
diff --git a/gtk/src/cellrenderertoggle.ccg b/gtk/src/cellrenderertoggle.ccg
index f736bd9..0d72730 100644
--- a/gtk/src/cellrenderertoggle.ccg
+++ b/gtk/src/cellrenderertoggle.ccg
@@ -25,16 +25,9 @@
namespace Gtk
{
-#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_Base CellRendererToggle::_property_renderable()
{
return property_active();
}
-#else
-Glib::ustring CellRendererToggle::_property_renderable()
-{
- return "active";
-}
-#endif //#GLIBMM_PROPERTIES_ENABLED
} //namespace Gtk
diff --git a/gtk/src/cellrenderertoggle.hg b/gtk/src/cellrenderertoggle.hg
index 5181879..5c8ace4 100644
--- a/gtk/src/cellrenderertoggle.hg
+++ b/gtk/src/cellrenderertoggle.hg
@@ -62,11 +62,7 @@ public:
_WRAP_PROPERTY("radio", bool)
_WRAP_PROPERTY("indicator-size", int)
-#ifdef GLIBMM_PROPERTIES_ENABLED
virtual Glib::PropertyProxy_Base _property_renderable();
-#else
- virtual Glib::ustring _property_renderable();
-#endif
};
} /* namespace Gtk */
diff --git a/gtk/src/cellview.ccg b/gtk/src/cellview.ccg
index 0bc6091..7af37d7 100644
--- a/gtk/src/cellview.ccg
+++ b/gtk/src/cellview.ccg
@@ -35,19 +35,11 @@ CellView::CellView(const Glib::ustring& text, bool use_markup)
if(use_markup)
{
- #ifdef GLIBMM_PROPERTIES_ENABLED
cell->property_markup() = text;
- #else
- cell->set_property("markup", text);
- #endif
}
else
{
- #ifdef GLIBMM_PROPERTIES_ENABLED
cell->property_text() = text;
- #else
- cell->set_property("text", text);
- #endif
}
pack_start(*cell);
@@ -59,11 +51,7 @@ CellView::CellView(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
{
Gtk::CellRendererPixbuf* cell = Gtk::manage(new Gtk::CellRendererPixbuf());
- #ifdef GLIBMM_PROPERTIES_ENABLED
cell->property_pixbuf() = pixbuf;
- #else
- cell->set_property("pixbuf", (void*)Glib::unwrap(pixbuf));
- #endif
pack_start(*cell);
}
diff --git a/gtk/src/clipboard.ccg b/gtk/src/clipboard.ccg
index 04ac5a9..0379162 100644
--- a/gtk/src/clipboard.ccg
+++ b/gtk/src/clipboard.ccg
@@ -53,37 +53,29 @@ static void SignalProxy_GetClear_gtk_callback_get(GtkClipboard*, GtkSelectionDat
{
SignalProxy_GetClear *const self = static_cast<SignalProxy_GetClear*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
Gtk::SelectionData_WithoutOwnership cppSelectionData(selection_data);
(self->slot_get_)(cppSelectionData, info);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static void SignalProxy_GetClear_gtk_callback_clear(GtkClipboard*, void* data)
{
SignalProxy_GetClear *const self = static_cast<SignalProxy_GetClear*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
(self->slot_clear_)();
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
delete self; // After this callback has been called, none of the 2 callbacks will be called again.
@@ -98,19 +90,15 @@ static void SignalProxy_Received_gtk_callback(GtkClipboard*, GtkSelectionData* s
{
Gtk::Clipboard::SlotReceived* the_slot = static_cast<Gtk::Clipboard::SlotReceived*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
Gtk::SelectionData cppSelectionData(selection_data, true /*take_copy=true*/);
(*the_slot)(cppSelectionData);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
delete the_slot;
}
@@ -121,9 +109,7 @@ static void SignalProxy_TargetsReceived_gtk_callback(GtkClipboard*, GdkAtom* ato
Gtk::Clipboard::SlotTargetsReceived *const
slot = static_cast<Gtk::Clipboard::SlotTargetsReceived*>(data);
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
try
-#endif
{
// TODO: This conversion should normally be performed in a custom
// Traits implementation. Alternatively, a real container could
@@ -135,12 +121,10 @@ static void SignalProxy_TargetsReceived_gtk_callback(GtkClipboard*, GdkAtom* ato
(*slot)(Glib::StringArrayHandle(names, n_names, Glib::OWNERSHIP_DEEP));
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
catch (...)
{
Glib::exception_handlers_invoke();
}
-#endif
delete slot; // the callback is only used once
}
@@ -149,18 +133,14 @@ static void SignalProxy_TextReceived_gtk_callback(GtkClipboard*, const char* tex
{
Gtk::Clipboard::SlotTextReceived* the_slot = static_cast<Gtk::Clipboard::SlotTextReceived*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
(*the_slot)((text) ? Glib::ustring(text) : Glib::ustring());
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
delete the_slot; // the callback is only used once
}
@@ -171,19 +151,15 @@ static void SignalProxy_RichTextReceived_gtk_callback(GtkClipboard*, GdkAtom for
Gtk::Clipboard::SlotRichTextReceived *const
slot = static_cast<Gtk::Clipboard::SlotRichTextReceived*>(data);
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
try
-#endif
{
(*slot)(Glib::convert_return_gchar_ptr_to_ustring(gdk_atom_name(format)),
(text) ? std::string(reinterpret_cast<const char*>(text), length) : std::string());
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
catch(...)
{
Glib::exception_handlers_invoke();
}
-#endif
delete slot; // the callback is only used once
}
@@ -191,19 +167,15 @@ static void SignalProxy_UrisReceived_gtk_callback(GtkClipboard*, gchar** uris, v
{
Gtk::Clipboard::SlotUrisReceived* the_slot = static_cast<Gtk::Clipboard::SlotUrisReceived*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
//Handle: Does this take ownership? It should probalby copy. murrayc.
(*the_slot)( Glib::StringArrayHandle(uris) );
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
delete the_slot; // the callback is only used once
}
@@ -212,18 +184,14 @@ static void SignalProxy_ImageReceived_gtk_callback(GtkClipboard*, GdkPixbuf* ima
{
Gtk::Clipboard::SlotImageReceived* the_slot = static_cast<Gtk::Clipboard::SlotImageReceived*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
(*the_slot)(Glib::wrap(image, true /* take_ref */));
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
delete the_slot; // the callback is only used once
}
diff --git a/gtk/src/colorselection.ccg b/gtk/src/colorselection.ccg
index bd3f54a..e665200 100644
--- a/gtk/src/colorselection.ccg
+++ b/gtk/src/colorselection.ccg
@@ -30,20 +30,16 @@ static void global_change_palette_hook_callback(GdkScreen* screen, const GdkColo
{
g_return_if_fail(global_change_palette_hook != 0);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
(*global_change_palette_hook)(
Glib::wrap(screen, true),
Gdk::ArrayHandle_Color(colors, n_colors, Glib::OWNERSHIP_NONE));
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static void old_change_palette_hook_callback(const Glib::RefPtr<Gdk::Screen>& screen,
@@ -114,15 +110,12 @@ ColorSelection::set_change_palette_hook(const ColorSelection::SlotChangePaletteH
if(old_func)
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
if(old_func != &global_change_palette_hook_callback)
old_slot = sigc::bind<-1>(sigc::ptr_fun(&old_change_palette_hook_callback), old_func);
else if(global_change_palette_hook)
old_slot = *global_change_palette_hook;
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
@@ -130,7 +123,6 @@ ColorSelection::set_change_palette_hook(const ColorSelection::SlotChangePaletteH
delete new_slot;
throw;
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
delete global_change_palette_hook;
diff --git a/gtk/src/container.ccg b/gtk/src/container.ccg
index 5bcd683..4d9bca8 100644
--- a/gtk/src/container.ccg
+++ b/gtk/src/container.ccg
@@ -27,23 +27,19 @@ namespace
static void container_foreach_callback(GtkWidget* widget_gobj, void* data)
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
Gtk::Container::ForeachSlot& slot = *static_cast<Gtk::Container::ForeachSlot*>(data);
Gtk::Widget *const widget = Glib::wrap(widget_gobj);
g_return_if_fail(widget != 0);
slot(*widget);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
@@ -56,20 +52,16 @@ static void Container_signal_remove_callback_normal(GtkContainer* self, GtkWidge
// Do not try to call a signal on a disassociated wrapper.
if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
(*static_cast<SlotType*>(slot))(Glib::wrap(p0)
);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
}
@@ -101,7 +93,6 @@ static void Container_signal_remove_callback(GtkContainer* self, GtkWidget* p0,
namespace Gtk
{
-#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
//Copy of generated callback:
void Container_Class::remove_callback_normal(GtkContainer* self, GtkWidget* p0)
{
@@ -115,20 +106,16 @@ void Container_Class::remove_callback_normal(GtkContainer* self, GtkWidget* p0)
// being overridden:
if(obj && obj->is_derived_())
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try // Trap C++ exceptions which would normally be lost because this is a C callback.
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
// Call the virtual member method, which derived classes might override.
obj->on_remove(Glib::wrap(p0)
);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
else
{
@@ -173,7 +160,6 @@ void Container_Class::remove_callback(GtkContainer* self, GtkWidget* p0)
(*base->remove)(self, p0);
}
}
-#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
void Container::foreach(const Container::ForeachSlot& slot)
{
@@ -234,7 +220,6 @@ void Container::remove(Widget& widget)
gtk_container_remove(gobj(), widget.gobj());
}
-#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
// static
void Container_Class::destroy_callback(GtkObject* self)
{
@@ -252,7 +237,6 @@ void Container_Class::destroy_callback(GtkObject* self)
if(base->destroy)
(*base->destroy)(self);
}
-#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
} // namespace Gtk
diff --git a/gtk/src/entrycompletion.ccg b/gtk/src/entrycompletion.ccg
index d2a81ab..2ee493e 100644
--- a/gtk/src/entrycompletion.ccg
+++ b/gtk/src/entrycompletion.ccg
@@ -27,15 +27,12 @@ static gboolean SignalProxy_Match_gtk_callback(GtkEntryCompletion* completion, c
{
Gtk::EntryCompletion::SlotMatch* the_slot = static_cast<Gtk::EntryCompletion::SlotMatch*>(user_data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
GtkTreeModel* tree_model = gtk_entry_completion_get_model(completion);
return (*the_slot)(Glib::convert_const_gchar_ptr_to_ustring(key),
Gtk::TreeModel::const_iterator(tree_model, iter)
);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
@@ -43,7 +40,6 @@ static gboolean SignalProxy_Match_gtk_callback(GtkEntryCompletion* completion, c
}
return false; //An arbitary default, just to avoid the compiler warning.
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static void SignalProxy_Match_gtk_callback_destroy(void* data)
@@ -112,10 +108,8 @@ static gboolean Widget_signal_match_selected_callback(GtkEntryCompletion* self,
// Do not try to call a signal on a disassociated wrapper.
if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
{
//This conversion is the custom-written part:
@@ -123,13 +117,11 @@ static gboolean Widget_signal_match_selected_callback(GtkEntryCompletion* self,
return static_cast<int>( (*static_cast<SlotType*>(slot))(cppIter) );
}
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
typedef gboolean RType;
@@ -144,10 +136,8 @@ static gboolean Widget_signal_match_selected_notify_callback(GtkEntryCompletion*
// Do not try to call a signal on a disassociated wrapper.
if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
{
//This conversion is the custom-written part:
@@ -155,13 +145,11 @@ static gboolean Widget_signal_match_selected_notify_callback(GtkEntryCompletion*
(*static_cast<SlotType*>(slot))(cppIter);
}
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
typedef gboolean RType;
@@ -184,10 +172,8 @@ static gboolean Widget_signal_cursor_on_match_callback(GtkEntryCompletion* self,
// Do not try to call a signal on a disassociated wrapper.
if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
{
//This conversion is the custom-written part:
@@ -195,13 +181,11 @@ static gboolean Widget_signal_cursor_on_match_callback(GtkEntryCompletion* self,
return static_cast<int>( (*static_cast<SlotType*>(slot))(cppIter) );
}
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
typedef gboolean RType;
@@ -216,10 +200,8 @@ static gboolean Widget_signal_cursor_on_match_notify_callback(GtkEntryCompletion
// Do not try to call a signal on a disassociated wrapper.
if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
{
//This conversion is the custom-written part:
@@ -227,13 +209,11 @@ static gboolean Widget_signal_cursor_on_match_notify_callback(GtkEntryCompletion
(*static_cast<SlotType*>(slot))(cppIter);
}
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
typedef gboolean RType;
@@ -254,7 +234,6 @@ const Glib::SignalProxyInfo EntryCompletion_signal_cursor_on_match_info =
namespace Gtk
{
-#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
//Hand-coded signal wrapping:
bool Gtk::EntryCompletion::on_match_selected(const TreeModel::iterator& iter)
@@ -284,22 +263,18 @@ gboolean EntryCompletion_Class::match_selected_callback_custom(GtkEntryCompletio
// being overridden:
if(obj && obj->is_derived_())
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try // Trap C++ exceptions which would normally be lost because this is a C callback.
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
// Call the virtual member method, which derived classes might override.
//This conversion is the custom-written part:
Gtk::TreeModel::iterator cppIter(c_model, c_iter);
return obj->on_match_selected(cppIter);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
else
{
@@ -315,7 +290,6 @@ gboolean EntryCompletion_Class::match_selected_callback_custom(GtkEntryCompletio
typedef gboolean RType;
return RType();
}
-#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
Glib::SignalProxy1< bool, const TreeModel::iterator& > EntryCompletion::signal_match_selected()
{
diff --git a/gtk/src/entrycompletion.hg b/gtk/src/entrycompletion.hg
index 2cbe929..3a32e4f 100644
--- a/gtk/src/entrycompletion.hg
+++ b/gtk/src/entrycompletion.hg
@@ -227,11 +227,9 @@ dnl
protected:
-#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
//Default Signal Handler:
virtual bool on_match_selected(const TreeModel::iterator& iter);
//No default handler for on_cursor_on_match(), to preserver ABI. TODO: Add this when we can break ABI.
-#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
};
} // namespace Gtk
diff --git a/gtk/src/filefilter.ccg b/gtk/src/filefilter.ccg
index a6130b4..7e698e4 100644
--- a/gtk/src/filefilter.ccg
+++ b/gtk/src/filefilter.ccg
@@ -24,10 +24,8 @@ static gboolean SignalProxy_Custom_gtk_callback(const GtkFileFilterInfo* filter_
{
Gtk::FileFilter::SlotCustom* the_slot = static_cast<Gtk::FileFilter::SlotCustom*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
//Create a suitable C++ instance to pass to the C++ method:
Gtk::FileFilter::Info cppInfo;
cppInfo.contains = (Gtk::FileFilterFlags)filter_info->contains;
@@ -37,14 +35,12 @@ static gboolean SignalProxy_Custom_gtk_callback(const GtkFileFilterInfo* filter_
cppInfo.mime_type = Glib::convert_const_gchar_ptr_to_ustring(filter_info->mime_type);
return (*the_slot)(cppInfo);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
return false; //arbitrary default;
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static void SignalProxy_Custom_gtk_callback_destroy(void* data)
diff --git a/gtk/src/iconview.ccg b/gtk/src/iconview.ccg
index b6764c3..977369d 100644
--- a/gtk/src/iconview.ccg
+++ b/gtk/src/iconview.ccg
@@ -29,18 +29,14 @@ static void proxy_foreach_callback(GtkIconView* /* icon_view */, GtkTreePath* pa
typedef Gtk::IconView::SlotForeach SlotType;
SlotType& slot = *static_cast<SlotType*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
slot(Gtk::TreeModel::Path(path, true));
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
} //anonymous namespace
diff --git a/gtk/src/linkbutton.ccg b/gtk/src/linkbutton.ccg
index cb6ec95..1f0944c 100644
--- a/gtk/src/linkbutton.ccg
+++ b/gtk/src/linkbutton.ccg
@@ -27,19 +27,15 @@ static void SignalProxy_UriHook_gtk_callback(GtkLinkButton *button, const gchar
{
Gtk::LinkButton::SlotUri* the_slot = static_cast<Gtk::LinkButton::SlotUri*>(user_data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLE
// use Slot::operator()
(*the_slot)(Glib::wrap(button), Glib::convert_const_gchar_ptr_to_ustring(link));
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLE
}
static void SignalProxy_UriHook_gtk_callback_destroy(void* data)
diff --git a/gtk/src/main.ccg b/gtk/src/main.ccg
index bcbd143..a27c6c1 100644
--- a/gtk/src/main.ccg
+++ b/gtk/src/main.ccg
@@ -228,20 +228,16 @@ gboolean RunSig::gtk_callback(gpointer data)
if(GtkMainConnectionNode::list_remove(conn_node))
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
// Recreate the specific SlotType from the generic slot_base.
SlotType* pSlot = static_cast<SlotType*>(conn_node->get_slot());
(*pSlot)();
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
// We don't need it anymore, since RunSig is a one-shot signal.
GtkMainConnectionNode::destroy_notify_handler(conn_node);
@@ -269,21 +265,17 @@ sigc::connection QuitSig::connect(const QuitSig::SlotType& slot, guint main_leve
// static
gboolean QuitSig::gtk_callback(gpointer data)
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
// Call the slot:
GtkMainConnectionNode* node = static_cast<GtkMainConnectionNode*>(data);
SlotType* pSlot = static_cast<SlotType*>(node->get_slot());
(*pSlot)();
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return 0;
}
@@ -305,21 +297,17 @@ sigc::connection KeySnooperSig::connect(const KeySnooperSig::SlotType& slot)
// static
gint KeySnooperSig::gtk_callback(GtkWidget* widget, GdkEventKey* event, gpointer data)
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
// Recreate the specific SlotType from the generic slot node.
GtkMainConnectionNode* conn_node = static_cast<GtkMainConnectionNode*>(data);
SlotType* pSlot = static_cast<SlotType*>(conn_node->get_slot());
return (*pSlot)(Glib::wrap(widget), event);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return 0;
}
@@ -416,15 +404,7 @@ Main::Main(int& argc, char**& argv, Glib::OptionContext& option_context)
add_gtk_option_group(option_context);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
option_context.parse(argc, argv);
- #else
- std::auto_ptr<Glib::Error> ex;
- option_context.parse(argc, argv, ex);
- //if(ex.get())
- // std::cerr << ex->what() << std::endl;
- //TODO: Pass the ex up to the caller?
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
}
diff --git a/gtk/src/menu.ccg b/gtk/src/menu.ccg
index 50f6766..4cc9306 100644
--- a/gtk/src/menu.ccg
+++ b/gtk/src/menu.ccg
@@ -30,18 +30,14 @@ static void SignalProxy_PopupPosition_gtk_callback(GtkMenu*, int* x, int* y, gbo
int temp_y = (y) ? *y : 0;
bool temp_push_in = (push_in) ? bool(*push_in) : false;
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
(*the_slot)(temp_x, temp_y, temp_push_in);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
if(x) *x = temp_x;
if(y) *y = temp_y;
diff --git a/gtk/src/menuitem.ccg b/gtk/src/menuitem.ccg
index f7502af..930fa7b 100644
--- a/gtk/src/menuitem.ccg
+++ b/gtk/src/menuitem.ccg
@@ -55,11 +55,7 @@ void MenuItem::add_accel_label(const Glib::ustring& label, bool mnemonic)
AccelLabel* pLabel = manage(new AccelLabel(label, mnemonic));
//Labels are centered by default, but in menus they should be left-aligned.
- #ifdef GLIBMM_PROPERTIES_ENABLED
pLabel->property_xalign() = 0.0;
- #else
- pLabel->set_property("xalign", 0.0f);
- #endif //GLIBMM_PROPERTIES_ENABLED
add(*pLabel);
diff --git a/gtk/src/menushell.ccg b/gtk/src/menushell.ccg
index 00760bc..6ca9db1 100644
--- a/gtk/src/menushell.ccg
+++ b/gtk/src/menushell.ccg
@@ -82,13 +82,10 @@ const MenuShell::MenuList& MenuShell::items() const
return items_proxy_;
}
-#ifdef GLIBMM_VFUNCS_ENABLED
void MenuShell_Class::insert_vfunc_callback(GtkMenuShell* self, GtkWidget* child, int position)
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
MenuShell *const obj = dynamic_cast<MenuShell*>(
Glib::ObjectBase::_get_current_wrapper((GObject*) self));
@@ -97,13 +94,11 @@ void MenuShell_Class::insert_vfunc_callback(GtkMenuShell* self, GtkWidget* child
{
Glib::wrap((GtkMenuItem*) child)->accelerate(*obj->accel_window_);
}
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
GtkMenuShellClass *const base = static_cast<GtkMenuShellClass*>(
g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)));
@@ -111,7 +106,6 @@ void MenuShell_Class::insert_vfunc_callback(GtkMenuShell* self, GtkWidget* child
if(base && base->insert)
(*base->insert)(self, child, position);
}
-#endif /* !GLIBMM_VFUNCS_ENABLED */
namespace Menu_Helpers
diff --git a/gtk/src/notebook.ccg b/gtk/src/notebook.ccg
index 380188f..a799b4f 100644
--- a/gtk/src/notebook.ccg
+++ b/gtk/src/notebook.ccg
@@ -31,19 +31,15 @@ static GtkNotebook* SignalProxy_WindowCreation_gtk_callback(GtkNotebook*, GtkWid
{
Gtk::Notebook::SlotWindowCreation *const
slot = static_cast<Gtk::Notebook::SlotWindowCreation*>(data);
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
try
-#endif
{
return Glib::unwrap((*slot)(Glib::wrap(page), x, y));
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
catch (...)
{
Glib::exception_handlers_invoke();
}
return 0;
-#endif
}
static void SignalProxy_WindowCreation_gtk_callback_destroy(void* data)
diff --git a/gtk/src/pagesetup.ccg b/gtk/src/pagesetup.ccg
index 96deb5d..c924c5a 100644
--- a/gtk/src/pagesetup.ccg
+++ b/gtk/src/pagesetup.ccg
@@ -20,53 +20,29 @@
namespace Gtk
{
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::RefPtr<PageSetup> PageSetup::create_from_key_file(const Glib::KeyFile& key_file)
-#else
-Glib::RefPtr<PageSetup> PageSetup::create_from_key_file(const Glib::KeyFile& key_file, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
Glib::RefPtr<PageSetup> result = PageSetup::create();
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
result->load_from_key_file(key_file);
- #else
- result->load_from_key_file(key_file, error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return result;
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::RefPtr<PageSetup> PageSetup::create_from_key_file(const Glib::KeyFile& key_file, const Glib::ustring& group_name)
-#else
-Glib::RefPtr<PageSetup> PageSetup::create_from_key_file(const Glib::KeyFile& key_file, const Glib::ustring& group_name, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
Glib::RefPtr<PageSetup> result = PageSetup::create();
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
result->load_from_key_file(key_file, group_name);
- #else
- result->load_from_key_file(key_file, group_name, error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return result;
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::RefPtr<PageSetup> PageSetup::create_from_file(const std::string& file_name)
-#else
-Glib::RefPtr<PageSetup> PageSetup::create_from_file(const std::string& file_name, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
Glib::RefPtr<PageSetup> result = PageSetup::create();
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
result->load_from_file(file_name);
- #else
- result->load_from_file(file_name, error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return result;
}
@@ -83,21 +59,12 @@ void PageSetup::save_to_key_file(Glib::KeyFile& key_file) const
gtk_page_setup_to_key_file(const_cast<GtkPageSetup*>(gobj()), (key_file).gobj(), 0);
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
bool PageSetup::load_from_key_file(const Glib::KeyFile& key_file)
-#else
-bool PageSetup::load_from_key_file(const Glib::KeyFile& key_file, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
GError* gerror = 0;
bool retvalue = gtk_page_setup_load_key_file(gobj(), const_cast<GKeyFile*>((key_file).gobj()), NULL, &(gerror));
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
::Glib::Error::throw_exception(gerror);
-#else
- if(gerror)
- error = ::Glib::Error::throw_exception(gerror);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
return retvalue;
}
diff --git a/gtk/src/pagesetup.hg b/gtk/src/pagesetup.hg
index 45486be..bbeb843 100644
--- a/gtk/src/pagesetup.hg
+++ b/gtk/src/pagesetup.hg
@@ -60,11 +60,7 @@ public:
*
* @newin{2,14}
*/
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<PageSetup> create_from_key_file(const Glib::KeyFile& key_file);
-#else
- static Glib::RefPtr<PageSetup> create_from_key_file(const Glib::KeyFile& key_file, std::auto_ptr<Glib::Error>& error);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Reads the page setup from the group @a group_name in the key file @a key_file.
* Returns a new PageSetup object with the restored
@@ -78,11 +74,7 @@ public:
*
* @newin{2,14}
*/
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<PageSetup> create_from_key_file(const Glib::KeyFile& key_file, const Glib::ustring& group_name);
-#else
- static Glib::RefPtr<PageSetup> create_from_key_file(const Glib::KeyFile& key_file, const Glib::ustring& group_name, std::auto_ptr<Glib::Error>& error);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
_IGNORE(gtk_page_setup_new_from_key_file)
/** Reads the page setup from the file @file_name. Returns a
@@ -94,11 +86,7 @@ public:
*
* @newin{2,14}
*/
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<PageSetup> create_from_file(const std::string& file_name);
-#else
- static Glib::RefPtr<PageSetup> create_from_file(const std::string& file_name, std::auto_ptr<Glib::Error>& error);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
_IGNORE(gtk_page_setup_new_from_file)
_WRAP_METHOD(Glib::RefPtr<PageSetup> copy() const, gtk_page_setup_copy)
@@ -118,11 +106,7 @@ public:
*
* @newin{2,14}
*/
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
bool load_from_key_file(const Glib::KeyFile& key_file);
-#else
- bool load_from_key_file(const Glib::KeyFile& key_file, std::auto_ptr<Glib::Error>& error);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
_WRAP_METHOD(PageOrientation get_orientation() const, gtk_page_setup_get_orientation)
_WRAP_METHOD(void set_orientation(PageOrientation orientation), gtk_page_setup_set_orientation)
diff --git a/gtk/src/printer.ccg b/gtk/src/printer.ccg
index 4a50ee7..df721e9 100644
--- a/gtk/src/printer.ccg
+++ b/gtk/src/printer.ccg
@@ -24,22 +24,18 @@ static gboolean SignalProxy_Custom_gtk_callback(GtkPrinter* gtk_printer, gpointe
{
const Gtk::SlotPrinterEnumerator* the_slot = static_cast<Gtk::SlotPrinterEnumerator*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
// Create a suitable C++ instance to pass to the C++ method;
Glib::RefPtr<Gtk::Printer> printer = Glib::wrap(gtk_printer, true);
return (*the_slot)(printer);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
return false; // arbitrary default;
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static void SignalProxy_Custom_gtk_callback_destroy(void* data)
diff --git a/gtk/src/printjob.ccg b/gtk/src/printjob.ccg
index 5f5e86a..e244b1f 100644
--- a/gtk/src/printjob.ccg
+++ b/gtk/src/printjob.ccg
@@ -24,29 +24,20 @@ static void SignalProxy_Custom_gtk_callback(GtkPrintJob* print_job, gpointer dat
{
const Gtk::PrintJob::SlotPrintJobComplete* the_slot = static_cast<Gtk::PrintJob::SlotPrintJobComplete*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
// Create a suitable C++ instance to pass to the C++ method;
Glib::RefPtr<Gtk::PrintJob> job = Glib::wrap(print_job);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
if (gerror) Glib::Error::throw_exception(gerror);
(*the_slot)(job);
- #else
- std::auto_ptr<Glib::Error> error = Glib::Error::throw_exception(gerror);
- (*the_slot)(job, error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static void SignalProxy_Custom_gtk_callback_destroy(void* data)
diff --git a/gtk/src/printjob.hg b/gtk/src/printjob.hg
index 65aa211..82b2235 100644
--- a/gtk/src/printjob.hg
+++ b/gtk/src/printjob.hg
@@ -72,19 +72,12 @@ public:
_IGNORE(gtk_print_job_send)
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
/** For example,
* void on_print_job_complete(const Glib::RefPtr<PrintJob>& job);
*
* @throws exception
*/
typedef sigc::slot< void, const Glib::RefPtr<PrintJob>& > SlotPrintJobComplete;
- #else
- /** For example,
- * void on_print_job_complete(const Glib::RefPtr<PrintJob>& job, std::auto_ptr<Glib::Error>& error);
- */
- typedef sigc::slot< void, const Glib::RefPtr<PrintJob>&, std::auto_ptr<Glib::Error>& > SlotPrintJobComplete;
- #endif
/** Sends the print job off to the printer.
* @param slot A function to call when the job completes or an error occurs.
diff --git a/gtk/src/printoperation.ccg b/gtk/src/printoperation.ccg
index 0353829..fd4da91 100644
--- a/gtk/src/printoperation.ccg
+++ b/gtk/src/printoperation.ccg
@@ -25,19 +25,15 @@ SignalProxy_PrintSetupDone_gtk_callback(GtkPageSetup* page_setup, gpointer data)
{
const Gtk::SlotPrintSetupDone* the_slot = static_cast<Gtk::SlotPrintSetupDone*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
Glib::RefPtr<Gtk::PageSetup> ps = Glib::wrap(page_setup);
(*the_slot)(ps);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch (...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
delete the_slot;
}
@@ -46,29 +42,17 @@ namespace Gtk
{
PrintOperationResult
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
PrintOperation::run(PrintOperationAction action)
-#else
-PrintOperation::run(PrintOperationAction action, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
GError* gerror = 0;
PrintOperationResult res =
(PrintOperationResult)gtk_print_operation_run(this->gobj(), (GtkPrintOperationAction)action, 0, &gerror);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
if (res == PRINT_OPERATION_RESULT_ERROR)
{
gtk_print_operation_get_error(this->gobj(), &gerror);
::Glib::Error::throw_exception(gerror);
}
- #else
- if (res == PRINT_OPERATION_RESULT_ERROR)
- {
- gtk_print_operation_get_error(this->gobj(), &gerror);
- error = ::Glib::Error::throw_exception(gerror);
- }
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return res;
}
diff --git a/gtk/src/printoperation.hg b/gtk/src/printoperation.hg
index 00606ba..931e6ae 100644
--- a/gtk/src/printoperation.hg
+++ b/gtk/src/printoperation.hg
@@ -90,11 +90,7 @@ public:
#m4 _CONVERSION(`GtkPrintOperationAction',`PrintOperationAction',`($2)$3')
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
PrintOperationResult run(PrintOperationAction action = PRINT_OPERATION_ACTION_PRINT_DIALOG);
- #else
- PrintOperationResult run(PrintOperationAction action, std::auto_ptr<Glib::Error>& error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
_WRAP_METHOD(PrintOperationResult run(PrintOperationAction action, Window& parent), gtk_print_operation_run, errthrow)
_WRAP_METHOD(PrintStatus get_status() const, gtk_print_operation_get_status)
diff --git a/gtk/src/printsettings.ccg b/gtk/src/printsettings.ccg
index c9724e5..bcf6eed 100644
--- a/gtk/src/printsettings.ccg
+++ b/gtk/src/printsettings.ccg
@@ -29,18 +29,14 @@ static void proxy_foreach_callback(const gchar* key, const gchar* value, void* d
typedef Gtk::PrintSettings::SlotForeach SlotType;
SlotType& slot = *static_cast<SlotType*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
slot(Glib::convert_const_gchar_ptr_to_ustring(key), Glib::convert_const_gchar_ptr_to_ustring(value));
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
} // anonymous namespace
@@ -78,53 +74,29 @@ const Glib::ustring PrintSettings::Keys::OUTPUT_URI = GTK_PRINT_SETTINGS_OUTPUT_
const Glib::ustring PrintSettings::Keys::WIN32_DRIVER_VERSION = GTK_PRINT_SETTINGS_WIN32_DRIVER_VERSION;
const Glib::ustring PrintSettings::Keys::WIN32_DRIVER_EXTRA = GTK_PRINT_SETTINGS_WIN32_DRIVER_EXTRA;
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::RefPtr<PrintSettings> PrintSettings::create_from_key_file(const Glib::KeyFile& key_file)
-#else
-Glib::RefPtr<PrintSettings> PrintSettings::create_from_key_file(const Glib::KeyFile& key_file, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
Glib::RefPtr<PrintSettings> result = PrintSettings::create();
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
result->load_from_key_file(key_file);
- #else
- result->load_from_key_file(key_file, error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return result;
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::RefPtr<PrintSettings> PrintSettings::create_from_key_file(const Glib::KeyFile& key_file, const Glib::ustring& group_name)
-#else
-Glib::RefPtr<PrintSettings> PrintSettings::create_from_key_file(const Glib::KeyFile& key_file, const Glib::ustring& group_name, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
Glib::RefPtr<PrintSettings> result = PrintSettings::create();
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
result->load_from_key_file(key_file, group_name);
- #else
- result->load_from_key_file(key_file, group_name, error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return result;
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::RefPtr<PrintSettings> PrintSettings::create_from_file(const std::string& file_name)
-#else
-Glib::RefPtr<PrintSettings> PrintSettings::create_from_file(const std::string& file_name, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
Glib::RefPtr<PrintSettings> result = PrintSettings::create();
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
result->load_from_file(file_name);
- #else
- result->load_from_file(file_name, error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return result;
}
@@ -183,21 +155,12 @@ void PrintSettings::set_page_ranges(const Glib::ArrayHandle<PrintSettings::PageR
}
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
bool PrintSettings::load_from_key_file(const Glib::KeyFile& key_file)
-#else
-bool PrintSettings::load_from_key_file(const Glib::KeyFile& key_file, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
GError* gerror = 0;
bool retvalue = gtk_print_settings_load_key_file(gobj(), const_cast<GKeyFile*>((key_file).gobj()), NULL, &(gerror));
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
::Glib::Error::throw_exception(gerror);
-#else
- if(gerror)
- error = ::Glib::Error::throw_exception(gerror);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
return retvalue;
}
diff --git a/gtk/src/printsettings.hg b/gtk/src/printsettings.hg
index fcdc4c9..1c9a368 100644
--- a/gtk/src/printsettings.hg
+++ b/gtk/src/printsettings.hg
@@ -65,11 +65,7 @@ protected:
*
* @newin{2,14}
*/
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<PrintSettings> create_from_key_file(const Glib::KeyFile& key_file);
-#else
- static Glib::RefPtr<PrintSettings> create_from_key_file(const Glib::KeyFile& key_file, std::auto_ptr<Glib::Error>& error);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Reads the print settings from the group @a group_name in @a key_file.
* Returns a new PrintSettings object with the restored settings,
@@ -84,11 +80,7 @@ protected:
*
* @newin{2,14}
*/
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<PrintSettings> create_from_key_file(const Glib::KeyFile& key_file, const Glib::ustring& group_name);
-#else
- static Glib::RefPtr<PrintSettings> create_from_key_file(const Glib::KeyFile& key_file, const Glib::ustring& group_name, std::auto_ptr<Glib::Error>& error);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
_IGNORE(gtk_print_settings_new_from_key_file)
/** Reads the print settings from @a file_name. Returns a new PrintSettings
@@ -102,11 +94,7 @@ protected:
*
* @newin{2,14}
*/
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<PrintSettings> create_from_file(const std::string& file_name);
-#else
- static Glib::RefPtr<PrintSettings> create_from_file(const std::string& file_name, std::auto_ptr<Glib::Error>& error);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
_IGNORE(gtk_print_settings_new_from_file)
public:
@@ -166,11 +154,7 @@ public:
*
* @newin{2,14}
*/
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
bool load_from_key_file(const Glib::KeyFile& key_file);
-#else
- bool load_from_key_file(const Glib::KeyFile& key_file, std::auto_ptr<Glib::Error>& error);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
//The save_ prefix was added to these functions to make them clearer. GTK+ didn't want to change them.
diff --git a/gtk/src/recentchooser.ccg b/gtk/src/recentchooser.ccg
index aba6f8d..4aaecbc 100644
--- a/gtk/src/recentchooser.ccg
+++ b/gtk/src/recentchooser.ccg
@@ -23,12 +23,9 @@ static int SignalProxy_Compare_gtk_callback(GtkRecentInfo* a, GtkRecentInfo* b,
{
const Gtk::RecentChooser::SlotCompare* the_slot = static_cast<Gtk::RecentChooser::SlotCompare*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return (*the_slot)(Glib::wrap(a, true /* take reference */), Glib::wrap(b, true /* take reference */));
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
@@ -36,7 +33,6 @@ static int SignalProxy_Compare_gtk_callback(GtkRecentInfo* a, GtkRecentInfo* b,
}
return 0;
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static void SignalProxy_Compare_gtk_callback_destroy(gpointer data)
diff --git a/gtk/src/recentfilter.ccg b/gtk/src/recentfilter.ccg
index 9b8bbca..c94485b 100644
--- a/gtk/src/recentfilter.ccg
+++ b/gtk/src/recentfilter.ccg
@@ -25,10 +25,8 @@ static gboolean SignalProxy_Custom_gtk_callback(const GtkRecentFilterInfo* filte
{
const Gtk::RecentFilter::SlotCustom* the_slot = static_cast<Gtk::RecentFilter::SlotCustom*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
// Create a suitable C++ instance to pass to the C++ method:
Gtk::RecentFilter::Info cppInfo;
cppInfo.contains = (Gtk::RecentFilterFlags)filter_info->contains;
@@ -50,14 +48,12 @@ static gboolean SignalProxy_Custom_gtk_callback(const GtkRecentFilterInfo* filte
cppInfo.age = filter_info->age;
return (*the_slot)(cppInfo);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
return false; // arbitrary default;
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static void SignalProxy_Custom_gtk_callback_destroy(void* data)
diff --git a/gtk/src/textbuffer.ccg b/gtk/src/textbuffer.ccg
index e0b0f88..3c896dc 100644
--- a/gtk/src/textbuffer.ccg
+++ b/gtk/src/textbuffer.ccg
@@ -32,12 +32,9 @@ static guint8* SignalProxy_Serialize(GtkTextBuffer* , GtkTextBuffer* content_buf
{
Gtk::TextBuffer::SlotSerialize* the_slot = static_cast<Gtk::TextBuffer::SlotSerialize*>(user_data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return (*the_slot)(Glib::wrap(content_buffer), Glib::wrap(start), Glib::wrap(end), *length);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
@@ -45,7 +42,6 @@ static guint8* SignalProxy_Serialize(GtkTextBuffer* , GtkTextBuffer* content_buf
}
return 0; // arbitrary value
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static void SignalProxy_Serialize_gtk_callback_destroy(void* user_data)
@@ -61,13 +57,10 @@ static gboolean SignalProxy_Deserialize(GtkTextBuffer* , GtkTextBuffer* content_
{
Gtk::TextBuffer::SlotDeserialize* the_slot = static_cast<Gtk::TextBuffer::SlotDeserialize*>(user_data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
(*the_slot)(Glib::wrap(content_buffer, true), Glib::wrap(iter), data, length, create_tags);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
@@ -76,7 +69,6 @@ static gboolean SignalProxy_Deserialize(GtkTextBuffer* , GtkTextBuffer* content_
}
return 0; // arbitrary value
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static void SignalProxy_Deserialize_gtk_callback_destroy(void* user_data)
diff --git a/gtk/src/textiter.hg b/gtk/src/textiter.hg
index 5efc1a0..0bdafd4 100644
--- a/gtk/src/textiter.hg
+++ b/gtk/src/textiter.hg
@@ -269,22 +269,18 @@ TextIter::PredicateAdapter<Predicate>::PredicateAdapter(const Predicate& predica
template <class Predicate>
gboolean TextIter::PredicateAdapter<Predicate>::gtk_callback(gunichar uc, void* user_data)
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
// This will either use Predicate::operator(), or call a function pointer.
// The explicit conditional expression avoids relying on an implicit
// conversion of the return type to int, which might be not available.
return (static_cast<TextIter::PredicateAdapter<Predicate>*>(user_data)->predicate_(uc)) ? 1 : 0;
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
return 0;
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
inline
diff --git a/gtk/src/treedragsource.ccg b/gtk/src/treedragsource.ccg
index dc46732..ca43921 100644
--- a/gtk/src/treedragsource.ccg
+++ b/gtk/src/treedragsource.ccg
@@ -26,7 +26,6 @@
namespace Gtk
{
-#ifdef GLIBMM_VFUNCS_ENABLED
//This vfunc wrapper is manually written, so that we can use a temporary instance for the SelectionData& output parameter:
gboolean TreeDragSource_Class::drag_data_get_vfunc_callback(GtkTreeDragSource* self, GtkTreePath* path, GtkSelectionData* selection_data)
@@ -41,20 +40,16 @@ gboolean TreeDragSource_Class::drag_data_get_vfunc_callback(GtkTreeDragSource* s
// being overridden:
if(obj && obj->is_derived_())
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try // Trap C++ exceptions which would normally be lost because this is a C callback.
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
// Call the virtual member method, which derived classes might override.
SelectionData_WithoutOwnership temp_instance(selection_data);
return static_cast<int>(obj->drag_data_get_vfunc(Gtk::TreePath(path, true), temp_instance));
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
else
{
@@ -85,7 +80,6 @@ g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) /
typedef bool RType;
return RType();
}
-#endif //GLIBMM_VFUNCS_ENABLED
} //namespace Gtk
diff --git a/gtk/src/treedragsource.hg b/gtk/src/treedragsource.hg
index 8dc0ea5..3663c44 100644
--- a/gtk/src/treedragsource.hg
+++ b/gtk/src/treedragsource.hg
@@ -63,9 +63,7 @@ dnl// We want to hand-code these C vfunc callbacks,
_WRAP_VFUNC(bool row_draggable(const TreeModel::Path& path) const, row_draggable)
//We hand-code this so that we can use a temporary instance for the SelectionData& output parameter:
- #ifdef GLIBMM_VFUNCS_ENABLED
virtual bool drag_data_get_vfunc(const TreeModel::Path& path, SelectionData& selection_data) const;
- #endif //GLIBMM_VFUNCS_ENABLED
_WRAP_VFUNC(bool drag_data_delete(const TreeModel::Path& path), drag_data_delete)
};
diff --git a/gtk/src/treemodel.ccg b/gtk/src/treemodel.ccg
index db4c7f8..dfdaf6c 100644
--- a/gtk/src/treemodel.ccg
+++ b/gtk/src/treemodel.ccg
@@ -30,18 +30,14 @@ static gboolean proxy_foreach_iter_callback(GtkTreeModel* model, GtkTreePath*, G
typedef Gtk::TreeModel::SlotForeachIter SlotType;
SlotType& slot = *static_cast<SlotType*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return slot(Gtk::TreeModel::iterator(model, iter));
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return 1;
}
@@ -51,18 +47,14 @@ static gboolean proxy_foreach_path_callback(GtkTreeModel*, GtkTreePath* path, Gt
typedef Gtk::TreeModel::SlotForeachPath SlotType;
SlotType& slot = *static_cast<SlotType*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return slot(Gtk::TreeModel::Path(path, true));
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return 1;
}
@@ -73,18 +65,14 @@ static gboolean proxy_foreach_path_and_iter_callback(GtkTreeModel* model, GtkTre
typedef Gtk::TreeModel::SlotForeachPathAndIter SlotType;
SlotType& slot = *static_cast<SlotType*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return slot(Gtk::TreeModel::Path(path, true), Gtk::TreeModel::iterator(model, iter));
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return 1;
}
@@ -165,7 +153,6 @@ bool TreeModel::iter_is_valid(const iterator& iter) const
return (!iter.is_end_ && iter.gobj()->stamp != 0);
}
-#ifdef GLIBMM_VFUNCS_ENABLED
// Custom vfunc callbacks, because the C++ vfuncs have different parameters and return types
// that can not be generated automatically:
@@ -181,10 +168,8 @@ gboolean TreeModel_Class::iter_next_vfunc_callback(GtkTreeModel* self, GtkTreeIt
// being overridden:
if(obj && obj->is_derived_())
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try // Trap C++ exceptions which would normally be lost because this is a C callback.
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
// Call the virtual member method, which derived classes might override.
TreeModel::iterator iter_input = TreeModel::iterator(self, iter);
TreeModel::iterator iter_next( self, iter ); //Copies iter by value.
@@ -195,13 +180,11 @@ gboolean TreeModel_Class::iter_next_vfunc_callback(GtkTreeModel* self, GtkTreeIt
*iter = *(iter_next.gobj());
return test;
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
else
{
@@ -256,10 +239,8 @@ gboolean TreeModel_Class::get_iter_vfunc_callback(GtkTreeModel* self, GtkTreeIte
// being overridden:
if(obj && obj->is_derived_())
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try // Trap C++ exceptions which would normally be lost because this is a C callback.
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
// Call the virtual member method, which derived classes might override.
Gtk::TreeModel::iterator iter_out(self, iter); //copies the iter by value.
gboolean test = obj->get_iter_vfunc(Gtk::TreePath(path, true), iter_out);
@@ -269,13 +250,11 @@ gboolean TreeModel_Class::get_iter_vfunc_callback(GtkTreeModel* self, GtkTreeIte
*iter = *(iter_out.gobj());
return test;
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
else
{
@@ -323,10 +302,8 @@ gboolean TreeModel_Class::iter_children_vfunc_callback(GtkTreeModel* self, GtkTr
// being overridden:
if(obj && obj->is_derived_())
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try // Trap C++ exceptions which would normally be lost because this is a C callback.
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
// Call the virtual member method, which derived classes might override.
Gtk::TreeModel::iterator iter_out(self, iter); //copies the iter by value.
@@ -350,13 +327,11 @@ gboolean TreeModel_Class::iter_children_vfunc_callback(GtkTreeModel* self, GtkTr
*iter = *(iter_out.gobj());
return test;
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
else
{
@@ -404,10 +379,8 @@ gboolean TreeModel_Class::iter_parent_vfunc_callback(GtkTreeModel* self, GtkTree
// being overridden:
if(obj && obj->is_derived_())
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try // Trap C++ exceptions which would normally be lost because this is a C callback.
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
// Call the virtual member method, which derived classes might override.
Gtk::TreeModel::iterator iter_out(self, iter);
Gtk::TreeModel::iterator child_cpp(self, child);
@@ -418,13 +391,11 @@ gboolean TreeModel_Class::iter_parent_vfunc_callback(GtkTreeModel* self, GtkTree
*iter = *(iter_out.gobj());
return test;
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
else
{
@@ -472,10 +443,8 @@ gboolean TreeModel_Class::iter_nth_child_vfunc_callback(GtkTreeModel* self, GtkT
// being overridden:
if(obj && obj->is_derived_())
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try // Trap C++ exceptions which would normally be lost because this is a C callback.
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
// Call the virtual member method, which derived classes might override.
Gtk::TreeModel::iterator iter_out(self, iter);
@@ -498,13 +467,11 @@ gboolean TreeModel_Class::iter_nth_child_vfunc_callback(GtkTreeModel* self, GtkT
*iter = *(iter_out.gobj());
return test;
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
else
{
@@ -574,10 +541,8 @@ gboolean TreeModel_Class::iter_n_children_vfunc_callback(GtkTreeModel* self, Gtk
// being overridden:
if(obj && obj->is_derived_())
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try // Trap C++ exceptions which would normally be lost because this is a C callback.
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
// Call the virtual member method, which derived classes might override.
//Deal with the case that iter is null, as described in the C docs:
@@ -585,13 +550,11 @@ gboolean TreeModel_Class::iter_n_children_vfunc_callback(GtkTreeModel* self, Gtk
return obj->iter_n_children_vfunc( Gtk::TreeModel::iterator(self, iter) );
else
return obj->iter_n_root_children_vfunc();
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
else
{
@@ -637,7 +600,6 @@ g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) /
return RType();
}
-#endif //GLIBMM_VFUNCS_ENABLED
void TreeModel::rows_reordered(const Path& path, const iterator& iter, const Glib::ArrayHandle<int>& new_order)
diff --git a/gtk/src/treemodel.hg b/gtk/src/treemodel.hg
index 90d0267..90aaf97 100644
--- a/gtk/src/treemodel.hg
+++ b/gtk/src/treemodel.hg
@@ -228,7 +228,6 @@ protected:
//These are only for deriving new TreeModels, which isn't very common or easy:
-#ifdef GLIBMM_VFUNCS_ENABLED
/** Override and implement this in a derived TreeModel class.
* Sets @a iter_next to refer to the node following @a iter it at the current level.
* If there is no next iter, false is returned and iter_next is set to be invalid.
@@ -293,7 +292,6 @@ protected:
* @result true if the operation was possible.
*/
virtual bool iter_nth_root_child_vfunc(int n, iterator& iter) const;
-#endif //GLIBMM_VFUNCS_ENABLED
@@ -326,7 +324,6 @@ dnl
*/
_WRAP_VFUNC(bool iter_has_child(const iterator& iter) const, iter_has_child)
-#ifdef GLIBMM_VFUNCS_ENABLED
/** Override and implement this in a derived TreeModel class.
* Returns the number of children that @a iter has.
* See also iter_n_root_children_vfunc().
@@ -343,7 +340,6 @@ dnl
* @result The number of children at the root level.
*/
virtual int iter_n_root_children_vfunc() const;
-#endif //GLIBMM_VFUNCS_ENABLED
/** Override and implement this in a derived TreeModel class.
* Lets the tree ref the node. This is an optional method for models to
diff --git a/gtk/src/treemodelfilter.ccg b/gtk/src/treemodelfilter.ccg
index 6bd9488..74f24ee 100644
--- a/gtk/src/treemodelfilter.ccg
+++ b/gtk/src/treemodelfilter.ccg
@@ -25,18 +25,14 @@ static gboolean SignalProxy_Visible_gtk_callback(GtkTreeModel* model, GtkTreeIte
{
Gtk::TreeModelFilter::SlotVisible* the_slot = static_cast<Gtk::TreeModelFilter::SlotVisible*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENAB
return (*the_slot)( Gtk::TreeModel::const_iterator(model, iter) );
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return FALSE; //An arbitary default, just to avoid the compiler warning.
}
@@ -51,10 +47,8 @@ static void SignalProxy_Modify_gtk_callback(GtkTreeModel* model, GtkTreeIter* it
{
Gtk::TreeModelFilter::SlotModify* the_slot = static_cast<Gtk::TreeModelFilter::SlotModify*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
//Initialize the input parameter with the appropriate type for this column.
//Then the C++ handler can just use operator==() without calling init on the value output arg:
Glib::ValueBase cppValue;
@@ -68,13 +62,11 @@ static void SignalProxy_Modify_gtk_callback(GtkTreeModel* model, GtkTreeIter* it
//If the C++ handler has inited value with an inappropriate GType, then this will fail,
//but they should not do that because it makes no sense.
g_value_copy(cppValue.gobj() /* source */, value /* destination */);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static void SignalProxy_Modify_gtk_callback_destroy(void* data)
diff --git a/gtk/src/treeselection.ccg b/gtk/src/treeselection.ccg
index 6a576f7..3f11b8b 100644
--- a/gtk/src/treeselection.ccg
+++ b/gtk/src/treeselection.ccg
@@ -27,18 +27,14 @@ static void proxy_foreach_selection_iter_callback(GtkTreeModel* model, GtkTreePa
typedef Gtk::TreeSelection::SlotForeachIter SlotType;
SlotType& slot = *static_cast<SlotType*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
slot(Gtk::TreeModel::iterator(model, iter));
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static void proxy_foreach_selection_path_callback(GtkTreeModel*, GtkTreePath* path, GtkTreeIter*, void* data)
@@ -46,18 +42,14 @@ static void proxy_foreach_selection_path_callback(GtkTreeModel*, GtkTreePath* pa
typedef Gtk::TreeSelection::SlotForeachPath SlotType;
SlotType& slot = *static_cast<SlotType*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
slot(Gtk::TreeModel::Path(path, true));
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static void proxy_foreach_selection_path_and_iter_callback(GtkTreeModel* model, GtkTreePath* path,
@@ -66,18 +58,14 @@ static void proxy_foreach_selection_path_and_iter_callback(GtkTreeModel* model,
typedef Gtk::TreeSelection::SlotForeachPathAndIter SlotType;
SlotType& slot = *static_cast<SlotType*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
slot(Gtk::TreeModel::Path(path, true), Gtk::TreeModel::iterator(model, iter));
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
@@ -86,14 +74,11 @@ static gboolean SignalProxy_Select_gtk_callback(GtkTreeSelection*, GtkTreeModel*
{
const Gtk::TreeSelection::SlotSelect* the_slot = static_cast<Gtk::TreeSelection::SlotSelect*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return (*the_slot)(Glib::wrap(model, true), // take copy
Gtk::TreePath(path, true), // take copy
path_currently_selected);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
@@ -101,7 +86,6 @@ static gboolean SignalProxy_Select_gtk_callback(GtkTreeSelection*, GtkTreeModel*
}
return 0;
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static void SignalProxy_Select_gtk_callback_destroy(void* data)
diff --git a/gtk/src/treesortable.ccg b/gtk/src/treesortable.ccg
index c24f2fa..7169e1c 100644
--- a/gtk/src/treesortable.ccg
+++ b/gtk/src/treesortable.ccg
@@ -22,13 +22,10 @@ static int SignalProxy_Compare_gtk_callback(GtkTreeModel* model, GtkTreeIter* lh
{
Gtk::TreeSortable::SlotCompare* the_slot = static_cast<Gtk::TreeSortable::SlotCompare*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
// use Slot::operator()
return (*the_slot)(Gtk::TreeIter(model, lhs), Gtk::TreeIter(model, rhs));
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
@@ -36,7 +33,6 @@ static int SignalProxy_Compare_gtk_callback(GtkTreeModel* model, GtkTreeIter* lh
}
return 0;
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static void SignalProxy_Compare_gtk_callback_destroy(void* data)
diff --git a/gtk/src/treeview.ccg b/gtk/src/treeview.ccg
index 4411ce4..b24a90f 100644
--- a/gtk/src/treeview.ccg
+++ b/gtk/src/treeview.ccg
@@ -38,18 +38,14 @@ static void SignalProxy_Mapping_gtk_callback(GtkTreeView* tree_view, GtkTreePath
{
Gtk::TreeView::SlotMapping* the_slot = static_cast<Gtk::TreeView::SlotMapping*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
(*the_slot)(Glib::wrap(tree_view), Gtk::TreePath(path, true));
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static gboolean SignalProxy_SearchEqual_gtk_callback(GtkTreeModel* model, int column, const char* key,
@@ -57,12 +53,9 @@ static gboolean SignalProxy_SearchEqual_gtk_callback(GtkTreeModel* model, int co
{
Gtk::TreeView::SlotSearchEqual* the_slot = static_cast<Gtk::TreeView::SlotSearchEqual*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return (*the_slot)(Glib::wrap(model, true), column, key, Gtk::TreeIter(model, iter));
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
@@ -70,7 +63,6 @@ static gboolean SignalProxy_SearchEqual_gtk_callback(GtkTreeModel* model, int co
}
return 0; // arbitrary value
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static void SignalProxy_SearchEqual_gtk_callback_destroy(void* data)
@@ -84,19 +76,15 @@ static gboolean SignalProxy_ColumnDrop_gtk_callback(GtkTreeView* tree_view, GtkT
{
Gtk::TreeView::SlotColumnDrop* the_slot = static_cast<Gtk::TreeView::SlotColumnDrop*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return (*the_slot)(Glib::wrap(tree_view), Glib::wrap(column),
Glib::wrap(prev_column), Glib::wrap(next_column));
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return 0; // arbitrary value
}
@@ -111,18 +99,14 @@ static void SignalProxy_SearchPosition_gtk_callback(GtkTreeView* /* tree_view */
{
Gtk::TreeView::SlotSearchPosition* the_slot = static_cast<Gtk::TreeView::SlotSearchPosition*>(user_data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
(*the_slot)(Glib::wrap(search_dialog));
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
static void SignalProxy_SearchPosition_gtk_callback_destroy(void* data)
diff --git a/gtk/src/treeview.hg b/gtk/src/treeview.hg
index 0229dca..a3036eb 100644
--- a/gtk/src/treeview.hg
+++ b/gtk/src/treeview.hg
@@ -976,11 +976,7 @@ void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::Cel
if(pCellToggle)
{
//Set the appropriate property,
- #ifdef GLIBMM_PROPERTIES_ENABLED
pCellToggle->property_activatable() = true;
- #else
- pCellToggle->set_property("activatable", true);
- #endif
//Connect to the appropriate signal, sending the model_column too
@@ -1009,11 +1005,7 @@ void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::Cel
if(pCellText)
{
//Set the appropriate property,
- #ifdef GLIBMM_PROPERTIES_ENABLED
pCellText->property_editable() = true;
- #else
- pCellText->set_property("editable", true);
- #endif
//Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
@@ -1041,11 +1033,7 @@ void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::Cel
if(pCellText)
{
//Set the appropriate property,
- #ifdef GLIBMM_PROPERTIES_ENABLED
pCellText->property_editable() = true;
- #else
- pCellText->set_property("editable", true);
- #endif
//Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
@@ -1073,11 +1061,7 @@ void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::Cel
if(pCellText)
{
//Set the appropriate property,
- #ifdef GLIBMM_PROPERTIES_ENABLED
pCellText->property_editable() = true;
- #else
- pCellText->set_property("editable", true);
- #endif
//Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
@@ -1105,11 +1089,7 @@ void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::Cel
if(pCellText)
{
//Set the appropriate property,
- #ifdef GLIBMM_PROPERTIES_ENABLED
pCellText->property_editable() = true;
- #else
- pCellText->set_property("editable", true);
- #endif
//Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
@@ -1137,11 +1117,7 @@ void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::Cel
if(pCellText)
{
//Set the appropriate property,
- #ifdef GLIBMM_PROPERTIES_ENABLED
pCellText->property_editable() = true;
- #else
- pCellText->set_property("editable", true);
- #endif
//Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
@@ -1168,11 +1144,7 @@ void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::Cel
if(pCellText)
{
//Set the appropriate property,
- #ifdef GLIBMM_PROPERTIES_ENABLED
pCellText->property_editable() = true;
- #else
- pCellText->set_property("editable", true);
- #endif
//Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
@@ -1218,11 +1190,7 @@ void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::Cel
//and connect to the appropriate signal, sending the model_column too,
if(pCellText)
{
- #ifdef GLIBMM_PROPERTIES_ENABLED
pCellText->property_editable() = true;
- #else
- pCellText->set_property("editable", true);
- #endif
//Some compilers (IRIX MipsPro) don't like us to give the pointer to a template function directly to sigc::ptr_fun():
typedef void (*type_func)(const Glib::ustring&, const Glib::ustring&, int, const Glib::RefPtr<Gtk::TreeModel>&);
@@ -1311,11 +1279,7 @@ void _auto_cell_data_func(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterato
if(used > 0)
{
//Show the text representation in the view:
- #ifdef GLIBMM_PROPERTIES_ENABLED
pTextRenderer->property_text() = buff;
- #else
- pTextRenderer->set_property("text", (void*)buff);
- #endif
}
}
}
diff --git a/gtk/src/treeviewcolumn.ccg b/gtk/src/treeviewcolumn.ccg
index 9b6a0b9..ab5cd18 100644
--- a/gtk/src/treeviewcolumn.ccg
+++ b/gtk/src/treeviewcolumn.ccg
@@ -52,22 +52,16 @@ void TreeViewColumn::add_attribute(Gtk::CellRenderer& cell, const Glib::ustring&
(GtkCellRenderer*) cell.gobj(), property_name.c_str(), column.index());
}
-#ifdef GLIBMM_PROPERTIES_ENABLED
void TreeViewColumn::add_attribute(const Glib::PropertyProxy_Base& property,
const TreeModelColumnBase& column)
{
gtk_tree_view_column_add_attribute(gobj(),
(GtkCellRenderer*) property.get_object()->gobj(), property.get_name(), column.index());
}
-#endif //GLIBMM_PROPERTIES_ENABLED
void TreeViewColumn::set_renderer(Gtk::CellRenderer& renderer, const TreeModelColumnBase& column)
{
-#ifdef GLIBMM_PROPERTIES_ENABLED
add_attribute(renderer._property_renderable(), column);
-#else
- add_attribute(renderer, renderer._property_renderable(), column);
-#endif
}
diff --git a/gtk/src/treeviewcolumn.hg b/gtk/src/treeviewcolumn.hg
index 8a003a4..d4e7386 100644
--- a/gtk/src/treeviewcolumn.hg
+++ b/gtk/src/treeviewcolumn.hg
@@ -119,9 +119,7 @@ public:
_WRAP_METHOD(void add_attribute(CellRenderer& cell_renderer, const Glib::ustring& attribute, int column),
gtk_tree_view_column_add_attribute)
-#ifdef GLIBMM_PROPERTIES_ENABLED
void add_attribute(const Glib::PropertyProxy_Base& property, const TreeModelColumnBase& column);
-#endif
void add_attribute(Gtk::CellRenderer& cell, const Glib::ustring& property_name, const TreeModelColumnBase& column);
_IGNORE(gtk_tree_view_column_set_attributes)
diff --git a/gtk/src/uimanager.ccg b/gtk/src/uimanager.ccg
index 61be11b..03a501d 100644
--- a/gtk/src/uimanager.ccg
+++ b/gtk/src/uimanager.ccg
@@ -26,22 +26,14 @@ namespace Gtk
typedef UIManager::ui_merge_id ui_merge_id; //Help gmmproc so that it does not need to add the full type name for the return type.
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
UIManager::ui_merge_id UIManager::add_ui_from_string(const Glib::ustring& buffer)
-#else
-UIManager::ui_merge_id UIManager::add_ui_from_string(const Glib::ustring& buffer, std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
{
GError* gerror = 0;
guint retvalue = gtk_ui_manager_add_ui_from_string(gobj(), buffer.c_str(), buffer.size(), &(gerror));
if (gerror)
{
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
::Glib::Error::throw_exception(gerror);
-#else
- error = ::Glib::Error::throw_exception(gerror);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
}
return retvalue;
}
diff --git a/gtk/src/uimanager.hg b/gtk/src/uimanager.hg
index 6d5db2b..b975aea 100644
--- a/gtk/src/uimanager.hg
+++ b/gtk/src/uimanager.hg
@@ -216,11 +216,7 @@ public:
* @throws exception
* @newin{2,4}
*/
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
ui_merge_id add_ui_from_string(const Glib::ustring& buffer);
- #else
- ui_merge_id add_ui_from_string(const Glib::ustring& buffer, std::auto_ptr<Glib::Error>& error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
_IGNORE(gtk_ui_manager_add_ui_from_string)
_WRAP_METHOD(ui_merge_id add_ui_from_file(const Glib::ustring& filename), gtk_ui_manager_add_ui_from_file, errthrow)
diff --git a/gtk/src/widget.ccg b/gtk/src/widget.ccg
index 133f037..854eba2 100644
--- a/gtk/src/widget.ccg
+++ b/gtk/src/widget.ccg
@@ -43,22 +43,18 @@ static void Widget_signal_drag_data_get_callback(GtkWidget* self, GdkDragContext
// Do not try to call a signal on a disassociated wrapper.
if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
{
SelectionData_WithoutOwnership temp_instance(p1);
(*static_cast<SlotType*>(slot))( Glib::wrap(p0, true), temp_instance, p2, p3 );
}
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
}
@@ -70,22 +66,18 @@ static void Widget_signal_selection_get_callback(GtkWidget* self, GtkSelectionDa
// Do not try to call a signal on a disassociated wrapper.
if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
{
SelectionData_WithoutOwnership temp_instance(p0);
(*static_cast<SlotType*>(slot))( temp_instance, p1, p2 );
}
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
}
@@ -95,7 +87,6 @@ static void Widget_signal_selection_get_callback(GtkWidget* self, GtkSelectionDa
namespace Gtk
{
-#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
//These default handler callbacks are custom implemented, so that we can create a temporary SelectionData instance.
//To do this, we used the optional custom_c_callback paramater to _WRAP_SIGNAL() in the .hg file.
void Widget_Class::selection_get_callback(GtkWidget* self, GtkSelectionData* p0, guint p1, guint p2)
@@ -110,20 +101,16 @@ void Widget_Class::selection_get_callback(GtkWidget* self, GtkSelectionData* p0,
// being overridden:
if(obj && obj->is_derived_())
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try // Trap C++ exceptions which would normally be lost because this is a C callback.
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
// Call the virtual member method, which derived classes might override.
SelectionData_WithoutOwnership temp_instance(p0);
obj->on_selection_get(temp_instance, p1, p2);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
else
{
@@ -149,20 +136,16 @@ void Widget_Class::drag_data_get_callback(GtkWidget* self, GdkDragContext* p0, G
// being overridden:
if(obj && obj->is_derived_())
{
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try // Trap C++ exceptions which would normally be lost because this is a C callback.
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
// Call the virtual member method, which derived classes might override.
SelectionData_WithoutOwnership temp_instance(p1);
obj->on_drag_data_get(Glib::wrap(p0, true), temp_instance, p2, p3);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
else
{
@@ -175,7 +158,6 @@ void Widget_Class::drag_data_get_callback(GtkWidget* self, GdkDragContext* p0, G
(*base->drag_data_get)(self, p0, p1, p2, p3);
}
}
-#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
Widget::~Widget()
{}
@@ -409,7 +391,6 @@ void Widget::drag_set_as_icon(const Glib::RefPtr<Gdk::DragContext>& context, int
gtk_drag_set_icon_widget(Glib::unwrap(context), gobj(), hot_x, hot_y);
}
-#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
void Widget_Class::hierarchy_changed_callback_custom(GtkWidget* self, GtkWidget* p0)
{
//GTKMM_LIFECYCLE
@@ -455,7 +436,6 @@ void Widget_Class::parent_set_callback_custom(GtkWidget* self, GtkWidget* p0)
(*base->parent_set)(self, p0);
}
}
-#endif //#GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
void Widget_Class::dispose_vfunc_callback(GObject* self)
{
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index 0a0d4b8..d2cf835 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -652,7 +652,7 @@ _DEPRECATE_IFDEF_START
*/
bool is_composite_child() const;
- /** @deprecated: Use the proper method to test individual states, suchas
+ /** @deprecated: Use the proper method to test individual states, suchas
* get_app_paintable(), get_can_default(),
* get_can_focus(), get_double_buffered(),
* has_default(), is_drawable(),
@@ -801,13 +801,9 @@ dnl// GTK+ code, e.g. when receiving the GDK_DELETE event. For details, look
dnl// at Gtk::Widget_Class::dispose_vfunc_callback() in widget.ccg.
dnl
_PUSH(SECTION_PCC_CLASS_INIT_VFUNCS)
-#endif //GLIBMM_VFUNCS_ENABLED //We always need dispose_vfunc_callback
reinterpret_cast<GObjectClass*>(klass)->dispose = &dispose_vfunc_callback;
-#ifdef GLIBMM_VFUNCS_ENABLED
_SECTION(SECTION_PH_VFUNCS)
-#endif //GLIBMM_VFUNCS_ENABLED //We always need dispose_vfunc_callback
static void dispose_vfunc_callback(GObject* self);
-#ifdef GLIBMM_VFUNCS_ENABLED
_POP()
#m4end
diff --git a/gtk/src/window.hg b/gtk/src/window.hg
index 237c9c2..e05aa14 100644
--- a/gtk/src/window.hg
+++ b/gtk/src/window.hg
@@ -130,13 +130,9 @@ dnl// GTK+ code, e.g. when receiving the GDK_DELETE event. For details, look
dnl// at Gtk::Window_Class::dispose_vfunc_callback() in window.ccg.
dnl
_PUSH(SECTION_PCC_CLASS_INIT_VFUNCS)
-#endif //GLIBMM_VFUNCS_ENABLED //We always need dispose_vfunc_callback
reinterpret_cast<GObjectClass*>(klass)->dispose = &dispose_vfunc_callback;
-#ifdef GLIBMM_VFUNCS_ENABLED
_SECTION(SECTION_PH_VFUNCS)
-#endif //GLIBMM_VFUNCS_ENABLED //We always need dispose_vfunc_callback
static void dispose_vfunc_callback(GObject* self);
-#ifdef GLIBMM_VFUNCS_ENABLED
_POP()
#m4end
diff --git a/tests/main_with_options/main.cc b/tests/main_with_options/main.cc
index 42e3895..265f8ca 100644
--- a/tests/main_with_options/main.cc
+++ b/tests/main_with_options/main.cc
@@ -101,10 +101,8 @@ int main(int argc, char *argv[])
ExampleOptionGroup group;
context.set_main_group(group);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
Gtk::Main main_instance(argc, argv, context);
//Here we can see the parsed values of our custom command-line arguments:
@@ -128,13 +126,11 @@ int main(int argc, char *argv[])
//Try --name="bobble" to change the window's title to "bobble", for instance.
Gtk::Window testWindow;
main_instance.run(testWindow); //Shows the window and returns when it is closed.
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(const Glib::Error& ex)
{
std::cout << "Exception: " << ex.what() << std::endl;
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
return 0;
diff --git a/tests/property_notification/main.cc b/tests/property_notification/main.cc
index ec121e6..f5cf16b 100644
--- a/tests/property_notification/main.cc
+++ b/tests/property_notification/main.cc
@@ -28,7 +28,6 @@ int main (int argc, char **argv)
button.connect_property_changed("color", sigc::ptr_fun(&on_property_color_changed));
-#ifdef GLIBMM_PROPERTIES_ENABLED
button.property_color().signal_changed().connect(sigc::ptr_fun(&on_property_color_changed_nicer_api));
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]