[gtkmm] Fix the build with GTK+ from git master.



commit 4413593be7a8e8aaa597f4f3e1127e38010ecfc7
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Sep 22 10:04:16 2010 +0200

    Fix the build with GTK+ from git master.
    
    * gtk/src/aboutdialog.[hg|ccg]:
    * gtk/src/linkbutton.[hg|ccg]: Remove the set/unset_*_link/url() methods,
      because they are now deprecated in GTK+.
    * gtk/src/wrapbox.hg: Change set/get_spreading() to
      set/get_horizontal/vertical_spreading(), as in the C API.

 ChangeLog               |   10 ++++++++
 gtk/src/aboutdialog.ccg |   58 +----------------------------------------------
 gtk/src/aboutdialog.hg  |   18 +-------------
 gtk/src/linkbutton.ccg  |   48 --------------------------------------
 gtk/src/linkbutton.hg   |   33 ++++----------------------
 gtk/src/wrapbox.hg      |   12 ++++++---
 6 files changed, 25 insertions(+), 154 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d8bf1fe..19c3968 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2010-09-22  Murray Cumming  <murrayc murrayc com>
 
+	Fix the build with GTK+ from git master.
+
+	* gtk/src/aboutdialog.[hg|ccg]:
+	* gtk/src/linkbutton.[hg|ccg]: Remove the set/unset_*_link/url() methods,
+  because they are now deprecated in GTK+.
+	* gtk/src/wrapbox.hg: Change set/get_spreading() to
+  set/get_horizontal/vertical_spreading(), as in the C API.
+
+2010-09-22  Murray Cumming  <murrayc murrayc com>
+
 	gtkmm: Window: Add default values to shape_combine_mask().
 
 	* gdk/src/window.hg: shape_combine_mask(): Add default values.
diff --git a/gtk/src/aboutdialog.ccg b/gtk/src/aboutdialog.ccg
index 2d962e5..2be6eee 100644
--- a/gtk/src/aboutdialog.ccg
+++ b/gtk/src/aboutdialog.ccg
@@ -1,7 +1,7 @@
 // -*- c++ -*-
 /* $Id: aboutdialog.ccg,v 1.5 2006/06/13 17:24:35 murrayc Exp $ */
 
-/* 
+/*
  *
  * Copyright 2004 The gtkmm Development Team
  *
@@ -21,59 +21,3 @@
  */
 
 #include <gtk/gtk.h>
-
-
-//We use a function instead of a static method, so we can make it static, so it is not exported.
-static void SignalProxy_ActivateLink_gtk_callback(GtkAboutDialog* about, const gchar* link, gpointer data)
-{
-  Gtk::AboutDialog::SlotActivateLink* the_slot = static_cast<Gtk::AboutDialog::SlotActivateLink*>(data);
-
-  try
-  {
-    Gtk::AboutDialog* pCppAbout = Glib::wrap(about);
-    (*the_slot)( *pCppAbout, Glib::convert_const_gchar_ptr_to_ustring(link) );
-  }
-  catch(...)
-  {
-    Glib::exception_handlers_invoke();
-  }
-}
-
-static void SignalProxy_ActivateLink_gtk_callback_destroy(void* data)
-{
-  Gtk::AboutDialog::SlotActivateLink* the_slot = static_cast<Gtk::AboutDialog::SlotActivateLink*>(data);
-  delete the_slot;
-}
-
-
-namespace Gtk
-{
-
-//static:
-void AboutDialog::set_email_hook(const SlotActivateLink& slot)
-{
-  // Create a copy of the slot object. A pointer to this will be passed
-  // through the callback's data parameter.  It will be deleted
-  // when SignalProxy_SlotForwardPage_gtk_callback_destroy() is called.
-  SlotActivateLink* slot_copy = new SlotActivateLink(slot);
-
-  gtk_about_dialog_set_email_hook(
-      &SignalProxy_ActivateLink_gtk_callback, slot_copy,
-      &SignalProxy_ActivateLink_gtk_callback_destroy);
-}
-  
-//static:
-void AboutDialog::set_url_hook(const SlotActivateLink& slot)
-{
-  // Create a copy of the slot object. A pointer to this will be passed
-  // through the callback's data parameter.  It will be deleted
-  // when SignalProxy_SlotForwardPage_gtk_callback_destroy() is called.
-  SlotActivateLink* slot_copy = new SlotActivateLink(slot);
-
-  gtk_about_dialog_set_url_hook(
-      &SignalProxy_ActivateLink_gtk_callback, slot_copy,
-      &SignalProxy_ActivateLink_gtk_callback_destroy);
-} 
-
-} // namespace Gtk
-
diff --git a/gtk/src/aboutdialog.hg b/gtk/src/aboutdialog.hg
index ea82d56..17f655e 100644
--- a/gtk/src/aboutdialog.hg
+++ b/gtk/src/aboutdialog.hg
@@ -29,6 +29,7 @@ namespace Gtk
 
 _WRAP_ENUM(License, GtkLicense)
 
+//TODO: Remove the mention of set_*_hook() when the C documentation has been fixed: https://bugzilla.gnome.org/show_bug.cgi?id=339745
 /** The AboutDialog offers a simple way to display information about a program like its logo, name, copyright,
  * website and license. It is also possible to give credits to the authors, documenters, translators and artists
  * who have worked on the program. An about dialog is typically opened when the user selects the About option
@@ -98,23 +99,6 @@ public:
   _WRAP_METHOD(bool get_wrap_license() const, gtk_about_dialog_get_wrap_license)
   _WRAP_METHOD(void set_wrap_license(bool wrap_license), gtk_about_dialog_set_wrap_license)
 
-  /** For instance,
-   * void on_activate_link_url(AboutDialog& about_dialog, const Glib::ustring& link);
-   */
-  typedef sigc::slot<void, AboutDialog& /* about_dialog */, const Glib::ustring& /* link */> SlotActivateLink;
-
-  /** Installs a global callback to be called whenever the user activates an email link in an about dialog.
-   * @param slot A function or method to call when an email link is activated.
-   */
-  static void set_email_hook(const SlotActivateLink& slot);
-  _IGNORE(gtk_about_dialog_set_email_hook)
-
-  /** Installs a global callback to be called whenever the user activates a URL link in an about dialog.
-   * @param slot A function or method to call when a URL link is activated.
-   */
-  static void set_url_hook(const SlotActivateLink& slot);
-  _IGNORE(gtk_about_dialog_set_url_hook)
-
   _WRAP_PROPERTY("program-name", Glib::ustring)
 
   _WRAP_PROPERTY("version", Glib::ustring)
diff --git a/gtk/src/linkbutton.ccg b/gtk/src/linkbutton.ccg
index 1f0944c..318fbcd 100644
--- a/gtk/src/linkbutton.ccg
+++ b/gtk/src/linkbutton.ccg
@@ -21,51 +21,3 @@
  */
 
 #include <gtk/gtk.h>
-
-
-static void SignalProxy_UriHook_gtk_callback(GtkLinkButton *button, const gchar *link, gpointer user_data)
-{
-  Gtk::LinkButton::SlotUri* the_slot = static_cast<Gtk::LinkButton::SlotUri*>(user_data);
-
-  try
-  {
-    // use Slot::operator()
-    (*the_slot)(Glib::wrap(button), Glib::convert_const_gchar_ptr_to_ustring(link));
-  }
-  catch(...)
-  {
-    Glib::exception_handlers_invoke();
-  }
-}
-
-static void SignalProxy_UriHook_gtk_callback_destroy(void* data)
-{
-  delete static_cast<Gtk::LinkButton::SlotUri*>(data);
-}
-
-
-namespace Gtk
-{
-
-LinkButton::LinkButton(const Glib::ustring& uri)
-:
-  _CONSTRUCT("uri", uri.c_str(), "label", uri.c_str()) //Note that the uri is used for the label too, as in the C _new() function.
-{}
-
-void LinkButton::set_uri_hook(const SlotUri& slot)
-{
-  //Create a copy of the slot. A pointer to this will be passed through the callback's data parameter.
-  //It will be deleted when TreeView_Private::SignalProxy_CellData_gtk_callback_destroy() is called.
-   SlotUri* slot_copy = new SlotUri(slot);
-
-  gtk_link_button_set_uri_hook (&SignalProxy_UriHook_gtk_callback, slot_copy, &SignalProxy_UriHook_gtk_callback_destroy);
-}
-
-void LinkButton::unset_uri_hook()
-{
-  gtk_link_button_set_uri_hook (0, 0, 0);
-}
-
-
-} // namespace Gtk
-
diff --git a/gtk/src/linkbutton.hg b/gtk/src/linkbutton.hg
index 8f012ab..dd79edd 100644
--- a/gtk/src/linkbutton.hg
+++ b/gtk/src/linkbutton.hg
@@ -1,7 +1,7 @@
 /* $Id: linkbutton.hg,v 1.2 2006/03/22 16:53:22 murrayc Exp $ */
 
 /* linkbutton.h
- * 
+ *
  * Copyright (C) 2006 The gtkmm Development Team
  *
  * This library is free software; you can redistribute it and/or
@@ -27,15 +27,16 @@ _PINCLUDE(gtkmm/private/button_p.h)
 namespace Gtk
 {
 
+//TODO: Remove the mention of set_*_hook() when the C documentation has been fixed: https://bugzilla.gnome.org/show_bug.cgi?id=339745
 /** Create buttons bound to a URL.
  *
  * A Gtk::LinkButton is a Gtk::Button with a hyperlink, similar to the one
  * used by web browsers, which triggers an action when clicked. It is useful
  * to show quick links to resources.
  *
- * The URI bound to a Gtk::LinkButton can be set specifically using set_uri(), 
+ * The URI bound to a Gtk::LinkButton can be set specifically using set_uri(),
  * and retrieved using get_uri().
- * Gtk::LinkButton offers a global hook, which is called when the used clicks on it: see set_uri_hook(). 
+ * Gtk::LinkButton offers a global hook, which is called when the used clicks on it: see set_uri_hook().
  *
  * The LinkButton widget looks like this:
  * @image html linkbutton1.png
@@ -58,33 +59,9 @@ public:
   _WRAP_METHOD(bool get_visited() const, gtk_link_button_get_visited)
   _WRAP_METHOD(void set_visited(bool visited = true), gtk_link_button_set_visited)
 
-  /** For instance,
-   * void on_linkbutton_uri(Gtk::LinkButton *button, const Glib::ustring& uri);
-   *
-   * @see set_uri_hook().
-   */
-  typedef sigc::slot<void, Gtk::LinkButton*, const Glib::ustring&> SlotUri;
-
-  /** Sets slot as the function that should be invoked every time a user clicks a LinkButton. 
-   * This function is called before every signal handler registered for the "clicked" signal.
-   *
-   * @param slot A function called each time a LinkButton is clicked.
-   * @newin{2,12}
-   */
-  static void set_uri_hook(const SlotUri& slot);
-  _IGNORE(gtk_link_button_set_uri_hook)
-
-  /** Unsets any previously set slot as the function that should be invoked every time a user clicks a LinkButton. 
-   * @see set_uri_hook().
-   * @newin{2,12}
-   */
-  static void unset_uri_hook();
-
-
   _WRAP_PROPERTY("uri", Glib::ustring)
-  _WRAP_PROPERTY("visited", bool)                                          
+  _WRAP_PROPERTY("visited", bool)
 };
 
 
 } // namespace Gtk
-
diff --git a/gtk/src/wrapbox.hg b/gtk/src/wrapbox.hg
index adde698..000d10b 100644
--- a/gtk/src/wrapbox.hg
+++ b/gtk/src/wrapbox.hg
@@ -39,7 +39,7 @@ _WRAP_ENUM(WrapBoxPacking, GtkWrapBoxPacking)
  * @ingroup Containers
  */
 class WrapBox
-: public Container //TODO: Also uses SizeRequest
+: public Container
 {
   _CLASS_GTKOBJECT(WrapBox, GtkWrapBox, GTK_WRAP_BOX, Gtk::Container, GtkContainer)
   _IMPLEMENTS_INTERFACE(Orientable)
@@ -49,8 +49,11 @@ public:
   _WRAP_METHOD(void set_allocation_mode(WrapAllocationMode mode), gtk_wrap_box_set_allocation_mode)
   _WRAP_METHOD(WrapAllocationMode get_allocation_mode() const, gtk_wrap_box_get_allocation_mode)
 
-  _WRAP_METHOD(void set_spreading(WrapBoxSpreading spreading), gtk_wrap_box_set_spreading)
-  _WRAP_METHOD(WrapBoxSpreading get_spreading() const, gtk_wrap_box_get_spreading)
+  _WRAP_METHOD(void set_vertical_spreading(WrapBoxSpreading spreading), gtk_wrap_box_set_vertical_preading)
+  _WRAP_METHOD(WrapBoxSpreading get_vertical_spreading() const, gtk_wrap_box_get_vertical_spreading)
+
+  _WRAP_METHOD(void set_horizontal_spreading(WrapBoxSpreading spreading), gtk_wrap_box_set_horizontal_preading)
+  _WRAP_METHOD(WrapBoxSpreading get_horizontal_spreading() const, gtk_wrap_box_get_horizontal_spreading)
 
   _WRAP_METHOD(void set_vertical_spacing(guint spacing), gtk_wrap_box_set_vertical_spacing)
   _WRAP_METHOD(guint get_vertical_spacing() const, gtk_wrap_box_get_vertical_spacing)
@@ -74,7 +77,8 @@ public:
 
 
   _WRAP_PROPERTY("allocation-mode", WrapAllocationMode)
-  _WRAP_PROPERTY("spreading", WrapBoxSpreading)
+  _WRAP_PROPERTY("vertical-spreading", WrapBoxSpreading)
+  _WRAP_PROPERTY("horizontal-spreading", WrapBoxSpreading)
   _WRAP_PROPERTY("minimum-line-children", guint)
   _WRAP_PROPERTY("natural-line-children", guint)
   _WRAP_PROPERTY("vertical-spacing", guint)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]