// Generated by gtkmmproc -- DO NOT MODIFY! #include #include // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- /* Copyright (C) 2007 The gtkmm Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include namespace Gio { #ifdef GLIBMM_EXCEPTIONS_ENABLED Glib::RefPtr AppInfo::create_from_commandline(const std::string& commandline, const std::string& application_name, AppInfoCreateFlags flags) #else Glib::RefPtr AppInfo::create_from_commandline(const std::string& commandline, const std::string& application_name, AppInfoCreateFlags flags, std::auto_ptr& error) #endif // GLIBMM_EXCEPTIONS_ENABLED { GAppInfo* capp_info = 0; GError* gerror = 0; capp_info = g_app_info_create_from_commandline(commandline.c_str(), application_name.c_str(), static_cast(flags), &gerror); if (gerror) #ifdef GLIBMM_EXCEPTIONS_ENABLED ::Glib::Error::throw_exception(gerror); #else error = ::Glib::Error::throw_exception(gerror); #endif //GLIBMM_EXCEPTIONS_ENABLED return Glib::wrap(capp_info); } Glib::ListHandle< Glib::RefPtr > AppInfo::get_all() { return Glib::ListHandle< Glib::RefPtr >(g_app_info_get_all(), Glib::OWNERSHIP_SHALLOW); } Glib::ListHandle< Glib::RefPtr > AppInfo::get_all_for_type(const std::string& content_type) { return Glib::ListHandle< Glib::RefPtr >( g_app_info_get_all_for_type(content_type.c_str()), Glib::OWNERSHIP_SHALLOW); } Glib::RefPtr AppInfo::get_default_for_type(const std::string& content_type, bool must_support_uris) { GAppInfo* cinfo = 0; cinfo = g_app_info_get_default_for_type(content_type.c_str(), static_cast(must_support_uris)); return Glib::wrap(cinfo); } Glib::RefPtr AppInfo::get_default_for_uri_scheme(const std::string& uri_scheme) { GAppInfo* cinfo = 0; cinfo = g_app_info_get_default_for_uri_scheme(uri_scheme.c_str()); return Glib::wrap(cinfo); } } // namespace Gio namespace { } // anonymous namespace namespace Glib { Glib::RefPtr wrap(GAppLaunchContext* object, bool take_copy) { return Glib::RefPtr( dynamic_cast (Glib::wrap_auto ((GObject*)(object), take_copy)) ); //We use dynamic_cast<> in case of multiple inheritance. } } /* namespace Glib */ namespace Gio { /* The *_Class implementation: */ const Glib::Class& AppLaunchContext_Class::init() { if(!gtype_) // create the GType if necessary { // Glib::Class has to know the class init function to clone custom types. class_init_func_ = &AppLaunchContext_Class::class_init_function; // This is actually just optimized away, apparently with no harm. // Make sure that the parent type has been created. //CppClassParent::CppObjectType::get_type(); // Create the wrapper type, with the same class/instance size as the base type. register_derived_type(g_app_launch_context_get_type()); // Add derived versions of interfaces, if the C type implements any interfaces: } return *this; } void AppLaunchContext_Class::class_init_function(void* g_class, void* class_data) { BaseClassType *const klass = static_cast(g_class); CppClassParent::class_init_function(klass, class_data); #ifdef GLIBMM_VFUNCS_ENABLED #endif //GLIBMM_VFUNCS_ENABLED #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED } #ifdef GLIBMM_VFUNCS_ENABLED #endif //GLIBMM_VFUNCS_ENABLED #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED Glib::ObjectBase* AppLaunchContext_Class::wrap_new(GObject* object) { return new AppLaunchContext((GAppLaunchContext*)object); } /* The implementation: */ GAppLaunchContext* AppLaunchContext::gobj_copy() { reference(); return gobj(); } AppLaunchContext::AppLaunchContext(const Glib::ConstructParams& construct_params) : Glib::Object(construct_params) { } AppLaunchContext::AppLaunchContext(GAppLaunchContext* castitem) : Glib::Object((GObject*)(castitem)) {} AppLaunchContext::~AppLaunchContext() {} AppLaunchContext::CppClassType AppLaunchContext::applaunchcontext_class_; // initialize static member GType AppLaunchContext::get_type() { return applaunchcontext_class_.init().get_type(); } GType AppLaunchContext::get_base_type() { return g_app_launch_context_get_type(); } AppLaunchContext::AppLaunchContext() : // Mark this class as non-derived to allow C++ vfuncs to be skipped. Glib::ObjectBase(0), Glib::Object(Glib::ConstructParams(applaunchcontext_class_.init())) { } Glib::RefPtr AppLaunchContext::create() { return Glib::RefPtr( new AppLaunchContext() ); } std::string AppLaunchContext::get_display(const Glib::RefPtr& info, const Glib::ListHandle< Glib::RefPtr >& files) { return Glib::convert_return_gchar_ptr_to_stdstring(g_app_launch_context_get_display(gobj(), Glib::unwrap(info), files.data())); } std::string AppLaunchContext::get_startup_notify_id(const Glib::RefPtr& info, const Glib::ListHandle< Glib::RefPtr >& files) { return Glib::convert_return_gchar_ptr_to_stdstring(g_app_launch_context_get_startup_notify_id(gobj(), Glib::unwrap(info), files.data())); } void AppLaunchContext::launch_failed(const std::string& startup_notify_id) { g_app_launch_context_launch_failed(gobj(), startup_notify_id.c_str()); } #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED #ifdef GLIBMM_VFUNCS_ENABLED #endif //GLIBMM_VFUNCS_ENABLED } // namespace Gio namespace Glib { Glib::RefPtr wrap(GAppInfo* object, bool take_copy) { return Glib::RefPtr( dynamic_cast (Glib::wrap_auto_interface ((GObject*)(object), take_copy)) ); //We use dynamic_cast<> in case of multiple inheritance. } } // namespace Glib namespace Gio { /* The *_Class implementation: */ const Glib::Interface_Class& AppInfo_Class::init() { if(!gtype_) // create the GType if necessary { // Glib::Interface_Class has to know the interface init function // in order to add interfaces to implementing types. class_init_func_ = &AppInfo_Class::iface_init_function; // We can not derive from another interface, and it is not necessary anyway. gtype_ = g_app_info_get_type(); } return *this; } void AppInfo_Class::iface_init_function(void* g_iface, void*) { BaseClassType *const klass = static_cast(g_iface); //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect. //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc g_assert(klass != 0); #ifdef GLIBMM_VFUNCS_ENABLED #endif //GLIBMM_VFUNCS_ENABLED #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED } #ifdef GLIBMM_VFUNCS_ENABLED #endif //GLIBMM_VFUNCS_ENABLED #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED Glib::ObjectBase* AppInfo_Class::wrap_new(GObject* object) { return new AppInfo((GAppInfo*)(object)); } /* The implementation: */ AppInfo::AppInfo() : Glib::Interface(appinfo_class_.init()) {} AppInfo::AppInfo(GAppInfo* castitem) : Glib::Interface((GObject*)(castitem)) {} AppInfo::AppInfo(const Glib::Interface_Class& interface_class) : Glib::Interface(interface_class) { } AppInfo::~AppInfo() {} // static void AppInfo::add_interface(GType gtype_implementer) { appinfo_class_.init().add_interface(gtype_implementer); } AppInfo::CppClassType AppInfo::appinfo_class_; // initialize static member GType AppInfo::get_type() { return appinfo_class_.init().get_type(); } GType AppInfo::get_base_type() { return g_app_info_get_type(); } bool AppInfo::equal(const Glib::RefPtr& other) const { return g_app_info_equal(const_cast(gobj()), Glib::unwrap(other)); } std::string AppInfo::get_id() const { return Glib::convert_const_gchar_ptr_to_stdstring(g_app_info_get_id(const_cast(gobj()))); } std::string AppInfo::get_name() const { return Glib::convert_const_gchar_ptr_to_stdstring(g_app_info_get_name(const_cast(gobj()))); } std::string AppInfo::get_description() const { return Glib::convert_const_gchar_ptr_to_stdstring(g_app_info_get_description(const_cast(gobj()))); } std::string AppInfo::get_executable() const { return Glib::convert_const_gchar_ptr_to_stdstring(g_app_info_get_executable(const_cast(gobj()))); } Glib::RefPtr AppInfo::get_icon() { Glib::RefPtr retvalue = Glib::wrap(g_app_info_get_icon(gobj())); if(retvalue) retvalue->reference(); //The function does not do a ref for us. return retvalue; } const Glib::RefPtr AppInfo::get_icon() const { return const_cast(this)->get_icon(); } #ifdef GLIBMM_EXCEPTIONS_ENABLED bool AppInfo::launch(const Glib::ListHandle& files, const Glib::RefPtr& launch_context) #else bool AppInfo::launch(const Glib::ListHandle& files, const Glib::RefPtr& launch_context, std::auto_ptr& error) #endif //GLIBMM_EXCEPTIONS_ENABLED { GError* gerror = 0; bool retvalue = g_app_info_launch(gobj(), files.data(), Glib::unwrap(launch_context), &(gerror)); #ifdef GLIBMM_EXCEPTIONS_ENABLED if(gerror) ::Glib::Error::throw_exception(gerror); #else if(gerror) error = ::Glib::Error::throw_exception(gerror); #endif //GLIBMM_EXCEPTIONS_ENABLED return retvalue; } bool AppInfo::supports_uris() const { return g_app_info_supports_uris(const_cast(gobj())); } bool AppInfo::supports_files() const { return g_app_info_supports_files(const_cast(gobj())); } #ifdef GLIBMM_EXCEPTIONS_ENABLED bool AppInfo::launch_uris(const Glib::ListHandle& uris, GAppLaunchContext* launch_context) #else bool AppInfo::launch_uris(const Glib::ListHandle& uris, GAppLaunchContext* launch_context, std::auto_ptr& error) #endif //GLIBMM_EXCEPTIONS_ENABLED { GError* gerror = 0; bool retvalue = g_app_info_launch_uris(gobj(), uris.data(), launch_context, &(gerror)); #ifdef GLIBMM_EXCEPTIONS_ENABLED if(gerror) ::Glib::Error::throw_exception(gerror); #else if(gerror) error = ::Glib::Error::throw_exception(gerror); #endif //GLIBMM_EXCEPTIONS_ENABLED return retvalue; } bool AppInfo::should_show() const { return g_app_info_should_show(const_cast(gobj())); } #ifdef GLIBMM_EXCEPTIONS_ENABLED bool AppInfo::set_as_default_for_type(const std::string& content_type) #else bool AppInfo::set_as_default_for_type(const std::string& content_type, std::auto_ptr& error) #endif //GLIBMM_EXCEPTIONS_ENABLED { GError* gerror = 0; bool retvalue = g_app_info_set_as_default_for_type(gobj(), content_type.c_str(), &(gerror)); #ifdef GLIBMM_EXCEPTIONS_ENABLED if(gerror) ::Glib::Error::throw_exception(gerror); #else if(gerror) error = ::Glib::Error::throw_exception(gerror); #endif //GLIBMM_EXCEPTIONS_ENABLED return retvalue; } #ifdef GLIBMM_EXCEPTIONS_ENABLED bool AppInfo::set_as_default_for_extension(const std::string& extension) #else bool AppInfo::set_as_default_for_extension(const std::string& extension, std::auto_ptr& error) #endif //GLIBMM_EXCEPTIONS_ENABLED { GError* gerror = 0; bool retvalue = g_app_info_set_as_default_for_extension(gobj(), extension.c_str(), &(gerror)); #ifdef GLIBMM_EXCEPTIONS_ENABLED if(gerror) ::Glib::Error::throw_exception(gerror); #else if(gerror) error = ::Glib::Error::throw_exception(gerror); #endif //GLIBMM_EXCEPTIONS_ENABLED return retvalue; } #ifdef GLIBMM_EXCEPTIONS_ENABLED bool AppInfo::add_supports_type(const std::string& content_type) #else bool AppInfo::add_supports_type(const std::string& content_type, std::auto_ptr& error) #endif //GLIBMM_EXCEPTIONS_ENABLED { GError* gerror = 0; bool retvalue = g_app_info_add_supports_type(gobj(), content_type.c_str(), &(gerror)); #ifdef GLIBMM_EXCEPTIONS_ENABLED if(gerror) ::Glib::Error::throw_exception(gerror); #else if(gerror) error = ::Glib::Error::throw_exception(gerror); #endif //GLIBMM_EXCEPTIONS_ENABLED return retvalue; } bool AppInfo::can_remove_supports_type() const { return g_app_info_can_remove_supports_type(const_cast(gobj())); } #ifdef GLIBMM_EXCEPTIONS_ENABLED bool AppInfo::remove_supports_type(const std::string& content_type) #else bool AppInfo::remove_supports_type(const std::string& content_type, std::auto_ptr& error) #endif //GLIBMM_EXCEPTIONS_ENABLED { GError* gerror = 0; bool retvalue = g_app_info_remove_supports_type(gobj(), content_type.c_str(), &(gerror)); #ifdef GLIBMM_EXCEPTIONS_ENABLED if(gerror) ::Glib::Error::throw_exception(gerror); #else if(gerror) error = ::Glib::Error::throw_exception(gerror); #endif //GLIBMM_EXCEPTIONS_ENABLED return retvalue; } #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED #ifdef GLIBMM_VFUNCS_ENABLED #endif //GLIBMM_VFUNCS_ENABLED } // namespace Gio