2013-09-01 11:51, Juan Rafael García
Blanco skrev:
Objects of classes that derive from Gtk::Object are not put in Glib::RefPtr<>s. I'm not sure why.Hi, I'm trying to wrap the new GtkPlacesSidebar api. I've run into a few problems, so I've read a little bit how my problem has been resolved for other classes. Still I'm not sure what to do about the following (maybe it would have been better to split this email into more pieces, sorry): - I thought that whenever a C pointer is used in the C api, a RefPtr should be put in place in gtkmm. Is that true? Does it apply almost everywhere? I've found widgets that do not follow this rule and they use C++ plain pointers instead. I don't think it's a problem that GtkPlacesSidebar is defined in the .c file. It is a problem that GtkPlacesSidebarClass is defined in the .c file.- The GtkPlacesSidebar struct is defined in the .c file. This forces me to add the no_default_handler keyword at the end of the _WRAP_SIGNAL macro. I've checked that not all Gtk classes are defined in the .c, and most are defined in the .h. Should we notify this issue to the C folks? GtkAccelMapClass is also defined in the .c file, but it does not contain signals or virtual functions, and then it's no problem. GtkPlacesSidebarClass is probably worth a bug report or a question on one of the gtk mailing lists. You might also ask them to put more specific data types in the registration of the signals. It would make life easier for you. E.g. in the registration of open_location the parameter location has type G_TYPE_OBJECT, but in GtkPlacesSidebarClass::open_location() its type is GFile*. I don't understand why it's not G_TYPE_FILE in the call to g_signal_new(). - What can be done when a signal handler declares one of its arguments as a gpointer? I've found little information on this. The signal handler I'm thinking of is in GtkPlacesSidebar and that argument is actually a GSList. - How can I create a const version of this: #m4 _CONVERSION(`GSList*',`std::vector< Glib::RefPtr<Gio::File>',`Glib::SListHandler< Glib::RefPtr<Gio::File> >::slist_to_vector($3,Glib::OWNERSHIP_DEEP)') _WRAP_METHOD(std::vector< Glib::RefPtr<Gio::File> > list_shortcuts(), gtk_places_sidebar_list_shortcuts) Thank you very much in advance. I hope not many of my questions are solved in the docs; I've checked them, I promise. Regards, Juan. |