gtkmm r1002 - in trunk: . gtk/src tools/m4



Author: murrayc
Date: Sat Jul 12 20:04:20 2008
New Revision: 1002
URL: http://svn.gnome.org/viewvc/gtkmm?rev=1002&view=rev

Log:
2008-07-12  Murray Cumming  <murrayc murrayc com>

* gtk/src/cellrenderercombo.hg:
* gtk/src/cellrendererpixbuf.hg: Added gicon property.
* gtk/src/clipboard.ccg:
* gtk/src/clipboard.hg: Added request_uris(), wait_for_uris(), 
wait_is_uris_available().
* gtk/src/entry.hg: Added overwrite_mode and text_length
properties.
* gtk/src/iconinfo.ccg:
* gtk/src/iconinfo.hg:
Added IconInfo(icon_theme, pixbuf) constructor
* gtk/src/icontheme.hg:
* gtk/src/image.hg: Added get_gicon() and gicon property.
* gtk/src/menu.hg: Added many new properties.
* gtk/src/plug.hg: Added embedded and socket_window properties.
* gtk/src/scalebutton.ccg:
* gtk/src/scalebutton.hg: Added set/get_orientation(), 
get_plus_button(), get_minus_button(), get_popup().
Added orientation property.
* gtk/src/settings.hg: Added many properties.
* gtk/src/widget.hg: Added damage_event signal.
Added window property.
* tools/m4/convert_gtk.m4: Added a conversion for GIcon.:


Modified:
   trunk/ChangeLog
   trunk/gtk/src/cellrenderercombo.hg
   trunk/gtk/src/cellrendererpixbuf.hg
   trunk/gtk/src/clipboard.ccg
   trunk/gtk/src/clipboard.hg
   trunk/gtk/src/entry.hg
   trunk/gtk/src/iconinfo.ccg
   trunk/gtk/src/iconinfo.hg
   trunk/gtk/src/icontheme.hg
   trunk/gtk/src/image.ccg
   trunk/gtk/src/image.hg
   trunk/gtk/src/menu.hg
   trunk/gtk/src/plug.hg
   trunk/gtk/src/scalebutton.ccg
   trunk/gtk/src/scalebutton.hg
   trunk/gtk/src/settings.hg
   trunk/gtk/src/widget.hg
   trunk/tools/m4/convert_gtk.m4

Modified: trunk/gtk/src/cellrenderercombo.hg
==============================================================================
--- trunk/gtk/src/cellrenderercombo.hg	(original)
+++ trunk/gtk/src/cellrenderercombo.hg	Sat Jul 12 20:04:20 2008
@@ -47,6 +47,9 @@
 
   _CTOR_DEFAULT
 
+  //TODO: Handle creation of the iter, providing the model. murrayc.
+  _WRAP_SIGNAL(void changed(const Glib::ustring& path, const Gtk::TreeModel::iterator& iter), "changed")
+ 
   _WRAP_PROPERTY("model", Glib::RefPtr<Gtk::TreeModel>)
   _WRAP_PROPERTY("text_column", int)
   _WRAP_PROPERTY("has_entry", bool)

Modified: trunk/gtk/src/cellrendererpixbuf.hg
==============================================================================
--- trunk/gtk/src/cellrendererpixbuf.hg	(original)
+++ trunk/gtk/src/cellrendererpixbuf.hg	Sat Jul 12 20:04:20 2008
@@ -20,6 +20,7 @@
  */
 
 #include <gtkmm/cellrenderer.h>
+#include <giomm/icon.h>
 _DEFS(gtkmm,gtk)
 _PINCLUDE(gtkmm/private/cellrenderer_p.h)
 
@@ -51,6 +52,7 @@
   _WRAP_PROPERTY("stock_id", Glib::ustring)
   _WRAP_PROPERTY("stock_size", guint)
   _WRAP_PROPERTY("stock_detail", Glib::ustring)
+  _WRAP_PROPERTY("gicon", Glib::RefPtr<Gio::Icon>)
 
 #ifdef GLIBMM_PROPERTIES_ENABLED
   virtual Glib::PropertyProxy_Base _property_renderable();

Modified: trunk/gtk/src/clipboard.ccg
==============================================================================
--- trunk/gtk/src/clipboard.ccg	(original)
+++ trunk/gtk/src/clipboard.ccg	Sat Jul 12 20:04:20 2008
@@ -204,6 +204,27 @@
   delete the_slot; // the callback is only used once
 }
 
+static void SignalProxy_UrisReceived_gtk_callback(GtkClipboard*, gchar** uris, void* data)
+{
+  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
+}
+
 static void SignalProxy_ImageReceived_gtk_callback(GtkClipboard*, GdkPixbuf* image, void* data)
 {
   Gtk::Clipboard::SlotImageReceived* the_slot = static_cast<Gtk::Clipboard::SlotImageReceived*>(data);
@@ -274,6 +295,14 @@
       &SignalProxy_RichTextReceived_gtk_callback, slot_copy);
 }
 
+void Clipboard::request_uris(const SlotUrisReceived& slot)
+{
+  // Create a copy of the slot. A pointer to this will be passed through the callback's data parameter.
+  SlotUrisReceived* slot_copy = new SlotUrisReceived(slot);
+
+  gtk_clipboard_request_uris(gobj(), &SignalProxy_UrisReceived_gtk_callback, slot_copy);
+}
+
 void Clipboard::request_image(const SlotImageReceived& slot)
 {
   // Create a copy of the slot. A pointer to this will be passed through the callback's data parameter.

Modified: trunk/gtk/src/clipboard.hg
==============================================================================
--- trunk/gtk/src/clipboard.hg	(original)
+++ trunk/gtk/src/clipboard.hg	Sat Jul 12 20:04:20 2008
@@ -158,7 +158,7 @@
   _IGNORE(gtk_clipboard_request_text)
 
   /// For instance: void on_rich_text_received(const Glib::ustring& format, const std::string& text);
-  typedef sigc::slot<void, const Glib::ustring& , const std::string&> SlotRichTextReceived;
+  typedef sigc::slot<void, const Glib::ustring&, const std::string&> SlotRichTextReceived;
 
   /** Requests the contents of the clipboard as rich text. When the rich text is later received, 
    * callback will be called.
@@ -174,6 +174,14 @@
    */
   void request_rich_text(const Glib::RefPtr<TextBuffer>& buffer, const SlotRichTextReceived& slot);
   _IGNORE(gtk_clipboard_request_rich_text)
+
+
+  /// For instance: void on_uris_received(const Glib::StringArrayHandle& uris);
+  typedef sigc::slot<void, const Glib::StringArrayHandle&> SlotUrisReceived;
+
+  //TODO: Documentation:
+  void request_uris(const SlotUrisReceived& slot);
+  _IGNORE(gtk_clipboard_request_uris)
   
   
   /// For instance: void on_image_received(const Glib::RefPtr<Gdk::Pixbuf>& text);
@@ -239,7 +247,8 @@
   
   _WRAP_METHOD(bool wait_is_text_available() const, gtk_clipboard_wait_is_text_available)
   _WRAP_METHOD(bool wait_is_rich_text_available(const Glib::RefPtr<TextBuffer>& buffer) const, gtk_clipboard_wait_is_rich_text_available)
-  _WRAP_METHOD(bool wait_is_image_available() const, gtk_clipboard_wait_is_image_available)  
+  _WRAP_METHOD(bool wait_is_image_available() const, gtk_clipboard_wait_is_image_available)
+  _WRAP_METHOD(bool wait_is_uris_available() const, gtk_clipboard_wait_is_uris_available)
   _WRAP_METHOD(bool wait_is_target_available(const Glib::ustring& target), gtk_clipboard_wait_is_target_available)
 
   /** Returns a list of targets that are present on the clipboard.
@@ -253,6 +262,8 @@
   Glib::StringArrayHandle wait_for_targets() const;
   _IGNORE(gtk_clipboard_wait_for_targets)
 
+  _WRAP_METHOD(Glib::StringArrayHandle wait_for_uris() const, gtk_clipboard_wait_for_uris)
+
   /** Hints that the clipboard data should be stored somewhere when the application exits or when store() 
    * is called.
    * 

Modified: trunk/gtk/src/entry.hg
==============================================================================
--- trunk/gtk/src/entry.hg	(original)
+++ trunk/gtk/src/entry.hg	Sat Jul 12 20:04:20 2008
@@ -135,6 +135,8 @@
   _WRAP_PROPERTY("text", Glib::ustring)
   _WRAP_PROPERTY("xalign", float)
   _WRAP_PROPERTY("truncate-multiline", bool)
+  _WRAP_PROPERTY("overwrite-mode", bool)
+  _WRAP_PROPERTY("text-length", guint)
 };
 
 } /* namespace Gtk */

Modified: trunk/gtk/src/iconinfo.ccg
==============================================================================
--- trunk/gtk/src/iconinfo.ccg	(original)
+++ trunk/gtk/src/iconinfo.ccg	Sat Jul 12 20:04:20 2008
@@ -16,10 +16,16 @@
  */
 
 #include <gtk/gtkicontheme.h>
+#include <gtkmm/icontheme.h>
  
 namespace Gtk
 {
 
+IconInfo::IconInfo(const Glib::RefPtr<IconTheme>& icon_theme, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
+: gobject_( gtk_icon_info_new_for_pixbuf(icon_theme->gobj(), pixbuf->gobj()) )
+{
+}
+
 bool IconInfo::get_attach_points(Glib::ArrayHandle<Gdk::Point>& /* points */) const
 {
   GdkPoint* c_attach_points = 0;

Modified: trunk/gtk/src/iconinfo.hg
==============================================================================
--- trunk/gtk/src/iconinfo.hg	(original)
+++ trunk/gtk/src/iconinfo.hg	Sat Jul 12 20:04:20 2008
@@ -26,12 +26,17 @@
 namespace Gtk
 {
 
+class IconTheme;
+
 class IconInfo
 {
   _CLASS_BOXEDTYPE(IconInfo, GtkIconInfo, NONE, gtk_icon_info_copy, gtk_icon_info_free)
   _IGNORE(gtk_icon_info_get_attach_points, gtk_icon_info_copy, gtk_icon_info_free)
 public:
 
+  IconInfo(const Glib::RefPtr<IconTheme>& icon_theme, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);
+  _IGNORE(gtk_icon_info_new_for_pixbuf)
+
   _DEPRECATE_IFDEF_START
   ///@deprecated Use the const version.
   operator bool();

Modified: trunk/gtk/src/icontheme.hg
==============================================================================
--- trunk/gtk/src/icontheme.hg	(original)
+++ trunk/gtk/src/icontheme.hg	Sat Jul 12 20:04:20 2008
@@ -19,6 +19,7 @@
 #include <gdkmm/screen.h>
 
 #include <gtkmm/iconinfo.h>
+#include <giomm/icon.h>
  
 _DEFS(gtkmm,gtk)
 _PINCLUDE(glibmm/private/object_p.h)
@@ -57,11 +58,15 @@
 
   _WRAP_METHOD(IconInfo lookup_icon(const Glib::ustring& icon_name, int size, IconLookupFlags flags) const, gtk_icon_theme_lookup_icon)
 
+  _WRAP_METHOD(IconInfo lookup_icon(const Glib::RefPtr<const Gio::Icon>& icon, int size, IconLookupFlags flags) const, gtk_icon_theme_lookup_by_gicon)
+
+
   #m4 _CONVERSION(`const Glib::StringArrayHandle&',`const gchar*[]',`const_cast<const gchar**>(($3).data())')
   _WRAP_METHOD(IconInfo choose_icon(const Glib::StringArrayHandle& icon_names, int size, IconLookupFlags flags), gtk_icon_theme_choose_icon)
 
   _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> load_icon(const Glib::ustring& icon_name, int size, IconLookupFlags flags = (IconLookupFlags)0) const, gtk_icon_theme_load_icon, errthrow)
 
+
   _WRAP_METHOD(Glib::ListHandle<Glib::ustring> list_icons(const Glib::ustring& context) const, gtk_icon_theme_list_icons)
 
   /** Lists the icons in the current icon theme.

Modified: trunk/gtk/src/image.ccg
==============================================================================
--- trunk/gtk/src/image.ccg	(original)
+++ trunk/gtk/src/image.ccg	Sat Jul 12 20:04:20 2008
@@ -94,14 +94,22 @@
   return Glib::convert_const_gchar_ptr_to_ustring(pchIconName);
 }
 
-Glib::ustring Image::get_icon_name(IconSize& size)
+Glib::RefPtr<Gio::Icon> Image::get_gicon(Gtk::IconSize& icon_size)
 {
-  const gchar* pchIconName = 0;
-  GtkIconSize cIconSize = GTK_ICON_SIZE_INVALID;
-  gtk_image_get_icon_name(const_cast<GtkImage*>(gobj()), &pchIconName, &cIconSize);
-  size = (IconSize)cIconSize;
-  return Glib::convert_const_gchar_ptr_to_ustring(pchIconName);
+  GIcon* cicon = 0;
+  GtkIconSize cicon_size = GTK_ICON_SIZE_INVALID;
+  gtk_image_get_gicon(gobj(), &cicon, &cicon_size);
+
+  icon_size = Gtk::IconSize(cicon_size);
+  return Glib::wrap(cicon);
+}
+
+Glib::RefPtr<const Gio::Icon> Image::get_gicon(Gtk::IconSize& icon_size) const
+{
+  Image* nonconstthis = const_cast<Image*>(this);
+  return nonconstthis->get_gicon(icon_size);
 }
 
+
 } // namespace Gtk
 

Modified: trunk/gtk/src/image.hg
==============================================================================
--- trunk/gtk/src/image.hg	(original)
+++ trunk/gtk/src/image.hg	Sat Jul 12 20:04:20 2008
@@ -22,6 +22,7 @@
 #include <gtkmm/misc.h>
 #include <gtkmm/iconset.h>
 #include <gdkmm/pixbufanimation.h>
+#include <giomm/icon.h>
 
 _DEFS(gtkmm,gtk)
 _PINCLUDE(gtkmm/private/misc_p.h)
@@ -136,6 +137,12 @@
   _WRAP_METHOD(Glib::RefPtr<Gdk::PixbufAnimation> get_animation(), gtk_image_get_animation, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Gdk::PixbufAnimation> get_animation() const, gtk_image_get_animation, refreturn, constversion)
 
+  //TODO: Documentation:
+  Glib::RefPtr<Gio::Icon> get_gicon(Gtk::IconSize& icon_size);
+
+  Glib::RefPtr<const Gio::Icon> get_gicon(Gtk::IconSize& icon_size) const;
+  _IGNORE(gtk_image_get_gicon)
+
   Glib::ustring get_icon_name() const;
   Glib::ustring get_icon_name(IconSize& size);
   _IGNORE(gtk_image_get_icon_name)
@@ -153,6 +160,7 @@
   _WRAP_PROPERTY("icon-size", int)
   _WRAP_PROPERTY("pixbuf-animation", Glib::RefPtr<Gdk::PixbufAnimation>)
   _WRAP_PROPERTY("storage-type", ImageType)
+  _WRAP_PROPERTY("gicon", Glib::RefPtr<Gio::Icon>)
 };
 
 } /* namespace Gtk */

Modified: trunk/gtk/src/menu.hg
==============================================================================
--- trunk/gtk/src/menu.hg	(original)
+++ trunk/gtk/src/menu.hg	Sat Jul 12 20:04:20 2008
@@ -116,7 +116,24 @@
   _IGNORE(gtk_menu_reorder_child)
 
   _IGNORE_SIGNAL("move_scroll")
+
+
+  _WRAP_PROPERTY("active", int)
+  _WRAP_PROPERTY("accel-group", Glib::RefPtr<AccelGroup>)
+  _WRAP_PROPERTY("accel-path", Glib::string)
+  _WRAP_PROPERTY("attach-widget", Widget*)
   _WRAP_PROPERTY("tearoff-title", Glib::ustring)
+  _WRAP_PROPERTY("tearoff-state", bool)
+  _WRAP_PROPERTY("monitor", int)
+  _WRAP_PROPERTY("vertical-padding", int)
+  _WRAP_PROPERTY("horizontal-padding", int)
+  _WRAP_PROPERTY("vertical-offset", int)
+  _WRAP_PROPERTY("horizontal-offset", int)
+  _WRAP_PROPERTY("double-arrows", bool)
+  _WRAP_PROPERTY("left-attach", int)
+  _WRAP_PROPERTY("right-attach", int)
+  _WRAP_PROPERTY("top-attach", int)
+  _WRAP_PROPERTY("bottom-attach", int)
 
 protected:
 

Modified: trunk/gtk/src/plug.hg
==============================================================================
--- trunk/gtk/src/plug.hg	(original)
+++ trunk/gtk/src/plug.hg	Sat Jul 12 20:04:20 2008
@@ -32,10 +32,13 @@
 public:
   Plug();
   explicit Plug(GdkNativeWindow socket_id);
-  explicit Plug(const Glib::RefPtr<Gdk::Display>& display, GdkNativeWindow socket_id);
+  Plug(const Glib::RefPtr<Gdk::Display>& display, GdkNativeWindow socket_id);
 
   _WRAP_METHOD(GdkNativeWindow get_id() const, gtk_plug_get_id)
 
+  _WRAP_PROPERTY("embedded", bool)
+  _WRAP_PROPERTY("socket-window", Glib::RefPtr<Gdk::Window>)
+
   _WRAP_SIGNAL(void embedded(), "embedded")
 };
 

Modified: trunk/gtk/src/scalebutton.ccg
==============================================================================
--- trunk/gtk/src/scalebutton.ccg	(original)
+++ trunk/gtk/src/scalebutton.ccg	Sat Jul 12 20:04:20 2008
@@ -25,6 +25,5 @@
 namespace Gtk
 {
 
-
 } // namespace Gtk
 

Modified: trunk/gtk/src/scalebutton.hg
==============================================================================
--- trunk/gtk/src/scalebutton.hg	(original)
+++ trunk/gtk/src/scalebutton.hg	Sat Jul 12 20:04:20 2008
@@ -51,6 +51,14 @@
   _WRAP_METHOD(Gtk::Adjustment*	get_adjustment(), gtk_scale_button_get_adjustment, refreturn)
   _WRAP_METHOD(Gtk::Adjustment*	get_adjustment() const, gtk_scale_button_get_adjustment, constversion)
   _WRAP_METHOD(void set_adjustment(Gtk::Adjustment& adjustment), gtk_scale_button_set_adjustment)
+  _WRAP_METHOD(Orientation get_orientation(), gtk_scale_button_get_orientation)
+  _WRAP_METHOD(void set_orientation(Orientation orientation), gtk_scale_button_set_orientation)
+  _WRAP_METHOD(Widget* get_plus_button(), gtk_scale_button_get_plus_button)
+  _WRAP_METHOD(const Widget* get_plus_button() const, gtk_scale_button_get_plus_button, constversion)
+  _WRAP_METHOD(Widget* get_minus_button(), gtk_scale_button_get_minus_button)
+  _WRAP_METHOD(const Widget* get_minus_button() const, gtk_scale_button_get_minus_button, constversion)
+  _WRAP_METHOD(Gtk::Widget* get_popup(), gtk_scale_button_get_popup)
+  _WRAP_METHOD(const Gtk::Widget* get_popup() const, gtk_scale_button_get_popup)
 
   _WRAP_SIGNAL(void value_changed(double value), "value_changed")
 
@@ -61,6 +69,7 @@
   _WRAP_PROPERTY("value", double)
   _WRAP_PROPERTY("size", IconSize)
   _WRAP_PROPERTY("adjustment", Adjustment*)
+  _WRAP_PROPERTY("orientation", Orientation)
 };
 
 

Modified: trunk/gtk/src/settings.hg
==============================================================================
--- trunk/gtk/src/settings.hg	(original)
+++ trunk/gtk/src/settings.hg	Sat Jul 12 20:04:20 2008
@@ -88,6 +88,13 @@
   _WRAP_PROPERTY("gtk-enable-mnemonics", bool)
   _WRAP_PROPERTY("gtk-enable-accels", bool)
   _WRAP_PROPERTY("gtk-recent-files-limit", int)
+  _WRAP_PROPERTY("gtk-im-module", Glib::ustring)
+  _WRAP_PROPERTY("gtk-recent-files-max-age", int)
+  _WRAP_PROPERTY("gtk-fontconfig-timestamp", int)
+  _WRAP_PROPERTY("gtk-sound-theme-name", Glib::ustring)
+  _WRAP_PROPERTY("gtk-enable-input-feedback-sounds", bool)
+  _WRAP_PROPERTY("gtk-enable-event-sounds", bool)
+  _WRAP_PROPERTY("gtk-enable-tooltips", bool)
   //TODO: Add others added since?
 
   // from GtkToolbar

Modified: trunk/gtk/src/widget.hg
==============================================================================
--- trunk/gtk/src/widget.hg	(original)
+++ trunk/gtk/src/widget.hg	Sat Jul 12 20:04:20 2008
@@ -887,6 +887,8 @@
   //(This was added to GTK+ 2.8 but forgotten by us until gtkmm 2.13/14):
   _WRAP_SIGNAL(bool grab_broken_event(GdkEventGrabBroken* event), "grab_broken_event", no_default_handler)
 
+  _WRAP_SIGNAL(bool damage_event(GdkEventExpose* event), "damage-event", no_default_handler)
+
   _WRAP_PROPERTY("name", Glib::ustring)
   _WRAP_PROPERTY("parent", Container*)
   _WRAP_PROPERTY("width_request", int)
@@ -906,6 +908,7 @@
   _WRAP_PROPERTY("has_tooltip", bool)
   _WRAP_PROPERTY("tooltip_markup", Glib::ustring)
   _WRAP_PROPERTY("tooltip_text", Glib::ustring)
+  _WRAP_PROPERTY("window", Glib::RefPtr<Gdk::Window>)
 
 protected:
   //comment in GTK+ header: "seldomly overidden"

Modified: trunk/tools/m4/convert_gtk.m4
==============================================================================
--- trunk/tools/m4/convert_gtk.m4	(original)
+++ trunk/tools/m4/convert_gtk.m4	Sat Jul 12 20:04:20 2008
@@ -620,3 +620,7 @@
 # Used by AboutDialog:
 #_CONVERSION(`const Glib::StringArrayHandle&',`const gchar**',`($3).data())')
 _CONVERSION(`const Glib::StringArrayHandle&',`const gchar**',`const_cast<const gchar**>(($3).data())')
+
+_CONVERSION(`const Glib::RefPtr<const Gio::Icon>&',`GIcon*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gio::Icon))
+
+



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