[gtkmm] PlacesSidebar: Pass vectors by reference in signals



commit d8017843fbca02db926462e7a5130252cae9036e
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Sep 25 11:14:30 2013 +0200

    PlacesSidebar: Pass vectors by reference in signals

 gtk/src/placessidebar.hg |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/gtk/src/placessidebar.hg b/gtk/src/placessidebar.hg
index 8763339..bcf3a46 100644
--- a/gtk/src/placessidebar.hg
+++ b/gtk/src/placessidebar.hg
@@ -72,10 +72,11 @@ public:
   _CTOR_DEFAULT
 
 
-  _WRAP_METHOD(void set_open_flags(PlacesOpenFlags flags = Gtk::PLACES_OPEN_NORMAL), 
gtk_places_sidebar_set_open_flags)
+  _WRAP_METHOD(void set_open_flags(PlacesOpenFlags flags = PLACES_OPEN_NORMAL), 
gtk_places_sidebar_set_open_flags)
   _WRAP_METHOD(PlacesOpenFlags get_open_flags() const, gtk_places_sidebar_get_open_flags)
 
   _WRAP_METHOD(void set_location(const Glib::RefPtr<const Gio::File>& location), 
gtk_places_sidebar_set_location)
+
   // transfer full
   // get_location returns a new Gio::File; modifiying the returned value does not modify the places sidebar
   _WRAP_METHOD(Glib::RefPtr<Gio::File> get_location() const, gtk_places_sidebar_get_location) 
@@ -85,6 +86,7 @@ public:
 
   _WRAP_METHOD(void add_shortcut(const Glib::RefPtr<Gio::File>& location), gtk_places_sidebar_add_shortcut)
   _WRAP_METHOD(void remove_shortcut(const Glib::RefPtr<Gio::File>& location), 
gtk_places_sidebar_remove_shortcut)
+
   // transfer full
   // list_shortcuts returns a copy of the list and its elements; modifiying the returned value does not 
modify the places sidebar
 #m4 _CONVERSION(`GSList*',`std::vector< Glib::RefPtr<Gio::File> >',`Glib::SListHandler< 
Glib::RefPtr<Gio::File> >::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
@@ -92,24 +94,27 @@ public:
 
   // transfer full
   // get_nth_bookmark returns a new Gio::File; modifiying the returned value does not modify the places 
sidebar
-  _WRAP_METHOD(Glib::RefPtr<Gio::File>  get_nth_bookmark(int n) const, gtk_places_sidebar_get_nth_bookmark)
+  _WRAP_METHOD(Glib::RefPtr<Gio::File> get_nth_bookmark(int n) const, gtk_places_sidebar_get_nth_bookmark)
 
   _WRAP_METHOD(void set_show_connect_to_server(bool show_connect_to_server = true), 
gtk_places_sidebar_set_show_connect_to_server)
   _WRAP_METHOD(bool get_show_connect_to_server() const, gtk_places_sidebar_get_show_connect_to_server)
 
 
+// We use no_default_handler with _WRAP_SIGNAL because the C *Class struct is hidden for GtkPlacesSidebar.
 // TODO
 // drag_action_requested and drag_perform_drop does not currently work due to an exec error while wrapping 
the
 // GList* argument; apparently execution crashes around Glib::wrap_create_new_wrapper_for_interface
-//#m4 _CONVERSION(`GdkDragContext*',`const Glib::RefPtr<Gdk::DragContext>&',Glib::wrap($3, true))
-//#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<Gio::File> >',`Glib::ListHandler< 
Glib::RefPtr<Gio::File> >::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
-//  _WRAP_SIGNAL(int drag_action_requested(const Glib::RefPtr<Gdk::DragContext>& context, const 
Glib::RefPtr<Gio::File>& dest_file, std::vector< Glib::RefPtr<Gio::File> > source_file_list), 
"drag_action_requested", no_default_handler)
-//  _WRAP_SIGNAL(void drag_perform_drop(const Glib::RefPtr<Gio::File>& dest_file, std::vector< 
Glib::RefPtr<Gio::File> > source_file_list, int action), "drag_perform_drop", no_default_handler)
+#m4 _CONVERSION(`GdkDragContext*',`const Glib::RefPtr<Gdk::DragContext>&',Glib::wrap($3, true))
+#m4 _CONVERSION(`GList*',`const std::vector< Glib::RefPtr<Gio::File> >&',`Glib::ListHandler< 
Glib::RefPtr<Gio::File> >::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+  _WRAP_SIGNAL(int drag_action_requested(const Glib::RefPtr<Gdk::DragContext>& context, const 
Glib::RefPtr<Gio::File>& dest_file, const std::vector< Glib::RefPtr<Gio::File> >& source_file_list), 
"drag_action_requested", no_default_handler)
+  _WRAP_SIGNAL(void drag_perform_drop(const Glib::RefPtr<Gio::File>& dest_file, const std::vector< 
Glib::RefPtr<Gio::File> >& source_file_list, int action), "drag_perform_drop", no_default_handler)
 
   _WRAP_SIGNAL(int drag_action_ask(int actions), "drag_action_ask", no_default_handler)
   _WRAP_SIGNAL(void open_location(const Glib::RefPtr<Gio::File>& location, PlacesOpenFlags open_flags), 
"open_location", no_default_handler)
+
 #m4 _CONVERSION(`GVolume*',`const Glib::RefPtr<Gio::Volume>&',Glib::wrap($3, true))
-  _WRAP_SIGNAL(void populate_popup(Gtk::Menu* menu, const Glib::RefPtr<Gio::File>& selected_item, const 
Glib::RefPtr<Gio::Volume>& selected_volume), "populate_popup", no_default_handler)
+  _WRAP_SIGNAL(void populate_popup(Menu* menu, const Glib::RefPtr<Gio::File>& selected_item, const 
Glib::RefPtr<Gio::Volume>& selected_volume), "populate_popup", no_default_handler)
+
   _WRAP_SIGNAL(void show_connect_to_server(), "show_connect_to_server", no_default_handler)
   _WRAP_SIGNAL(void show_error_message(const Glib::ustring& primary, const Glib::ustring& secondary), 
"show_error_message", no_default_handler)
 


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