// Generated by gmmproc 2.45.3 -- DO NOT MODIFY! #include #include #include /* Copyright (C) 2006 The gtkmm Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include namespace Gtk { RecentInfo::operator bool() const { return gobj() != 0; } Glib::StringArrayHandle RecentInfo::get_applications() const { gsize length = 0; char** const applications = gtk_recent_info_get_applications(const_cast(gobj()), &length); return Glib::StringArrayHandle(applications, length, Glib::OWNERSHIP_DEEP); } bool RecentInfo::get_application_info(const Glib::ustring& app_name, std::string& app_exec, guint& count, time_t& time_) const { const char* app_exec_cstr = 0; const int found = gtk_recent_info_get_application_info( const_cast(gobj()), app_name.c_str(), &app_exec_cstr, &count, &time_); if (app_exec_cstr) app_exec = app_exec_cstr; else app_exec.erase(); return (found != 0); } Glib::StringArrayHandle RecentInfo::get_groups() const { gsize length = 0; char** const groups = gtk_recent_info_get_groups(const_cast(gobj()), &length); return Glib::StringArrayHandle(groups, length, Glib::OWNERSHIP_DEEP); } RecentInfoTraits::CppType RecentInfoTraits::to_cpp_type(const CType& obj) { return Glib::wrap(const_cast(obj), true); } } // namespace Gtk namespace Glib { GType Value >::value_type() { return gtk_recent_info_get_type(); } void Value >::set(const CppType& data) { set_boxed(Glib::unwrap(data)); } Value >::CppType Value >::get() const { return Glib::wrap(static_cast(get_boxed()), true); } } // namespace Glib namespace { } // anonymous namespace /* Why reinterpret_cast(gobject) is needed: * * A RecentInfo instance is in fact always a GtkRecentInfo instance. * Unfortunately, GtkRecentInfo cannot be a member of RecentInfo, * because it is an opaque struct. Also, the C interface does not provide * any hooks to install a destroy notification handler, thus we cannot * wrap it dynamically either. * * The cast works because RecentInfo does not have any member data, and * it is impossible to derive from it. This is ensured by not implementing * the (protected) default constructor. The ctor is protected rather than * private just to avoid a compile warning. */ namespace Glib { Glib::RefPtr wrap(GtkRecentInfo* object, bool take_copy) { if(take_copy && object) gtk_recent_info_ref(object); // See the comment at the top of this file, if you want to know why the cast works. return Glib::RefPtr(reinterpret_cast(object)); } } // namespace Glib namespace Gtk { void RecentInfo::reference() const { // See the comment at the top of this file, if you want to know why the cast works. gtk_recent_info_ref(reinterpret_cast(const_cast(this))); } void RecentInfo::unreference() const { // See the comment at the top of this file, if you want to know why the cast works. gtk_recent_info_unref(reinterpret_cast(const_cast(this))); } GtkRecentInfo* RecentInfo::gobj() { // See the comment at the top of this file, if you want to know why the cast works. return reinterpret_cast(this); } const GtkRecentInfo* RecentInfo::gobj() const { // See the comment at the top of this file, if you want to know why the cast works. return reinterpret_cast(this); } GtkRecentInfo* RecentInfo::gobj_copy() const { // See the comment at the top of this file, if you want to know why the cast works. GtkRecentInfo *const gobject = reinterpret_cast(const_cast(this)); gtk_recent_info_ref(gobject); return gobject; } Glib::ustring RecentInfo::get_uri() const { return Glib::convert_const_gchar_ptr_to_ustring(gtk_recent_info_get_uri(const_cast(gobj()))); } Glib::ustring RecentInfo::get_display_name() const { return Glib::convert_const_gchar_ptr_to_ustring(gtk_recent_info_get_display_name(const_cast(gobj()))); } Glib::ustring RecentInfo::get_description() const { return Glib::convert_const_gchar_ptr_to_ustring(gtk_recent_info_get_description(const_cast(gobj()))); } Glib::ustring RecentInfo::get_mime_type() const { return Glib::convert_const_gchar_ptr_to_ustring(gtk_recent_info_get_mime_type(const_cast(gobj()))); } time_t RecentInfo::get_added() const { return gtk_recent_info_get_added(const_cast(gobj())); } time_t RecentInfo::get_modified() const { return gtk_recent_info_get_modified(const_cast(gobj())); } time_t RecentInfo::get_visited() const { return gtk_recent_info_get_visited(const_cast(gobj())); } bool RecentInfo::get_private_hint() const { return gtk_recent_info_get_private_hint(const_cast(gobj())); } Glib::ustring RecentInfo::last_application() const { return Glib::convert_return_gchar_ptr_to_ustring(gtk_recent_info_last_application(const_cast(gobj()))); } bool RecentInfo::has_application(const Glib::ustring& app_name) const { return gtk_recent_info_has_application(const_cast(gobj()), app_name.c_str()); } bool RecentInfo::has_group(const Glib::ustring& group) const { return gtk_recent_info_has_group(const_cast(gobj()), group.c_str()); } Glib::RefPtr RecentInfo::get_icon(int size) { Glib::RefPtr retvalue = Glib::wrap(gtk_recent_info_get_icon(gobj(), size)); if(retvalue) retvalue->reference(); //The function does not do a ref for us. return retvalue; } Glib::RefPtr RecentInfo::get_icon(int size) const { return const_cast(this)->get_icon(size); } Glib::ustring RecentInfo::get_short_name() const { return Glib::convert_return_gchar_ptr_to_ustring(gtk_recent_info_get_short_name(const_cast(gobj()))); } Glib::ustring RecentInfo::get_uri_display() const { return Glib::convert_return_gchar_ptr_to_ustring(gtk_recent_info_get_uri_display(const_cast(gobj()))); } int RecentInfo::get_age() const { return gtk_recent_info_get_age(const_cast(gobj())); } bool RecentInfo::is_local() const { return gtk_recent_info_is_local(const_cast(gobj())); } bool RecentInfo::exists() const { return gtk_recent_info_exists(const_cast(gobj())); } bool RecentInfo::equal(const RecentInfo& b) const { return gtk_recent_info_match(const_cast(gobj()), const_cast((b).gobj())); } } // namespace Gtk