"Fossies" - the Fresh Open Source Software Archive

Member "glibmm-2.74.0/untracked/gio/giomm/applaunchcontext.cc" (19 Sep 2022, 5113 Bytes) of package /linux/misc/glibmm-2.74.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "applaunchcontext.cc" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes reports: 2.73.2_vs_2.74.0 or 2.72.1_vs_2.74.0.

    1 // Generated by gmmproc 2.74.0 -- DO NOT MODIFY!
    2 
    3 
    4 #include <glibmm.h>
    5 
    6 #include <giomm/applaunchcontext.h>
    7 #include <giomm/private/applaunchcontext_p.h>
    8 
    9 
   10 /* Copyright (C) 2007 The gtkmm Development Team
   11  *
   12  * This library is free software; you can redistribute it and/or
   13  * modify it under the terms of the GNU Lesser General Public
   14  * License as published by the Free Software Foundation; either
   15  * version 2.1 of the License, or (at your option) any later version.
   16  *
   17  * This library is distributed in the hope that it will be useful,
   18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   20  * Lesser General Public License for more details.
   21  *
   22  * You should have received a copy of the GNU Lesser General Public
   23  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
   24  */
   25 
   26 #include <giomm/appinfo.h>
   27 #include <giomm/file.h>
   28 #include <gio/gio.h>
   29 
   30 namespace Gio
   31 {
   32 
   33 } // namespace Gio
   34 
   35 namespace
   36 {
   37 } // anonymous namespace
   38 
   39 
   40 namespace Glib
   41 {
   42 
   43 Glib::RefPtr<Gio::AppLaunchContext> wrap(GAppLaunchContext* object, bool take_copy)
   44 {
   45   return Glib::make_refptr_for_instance<Gio::AppLaunchContext>( dynamic_cast<Gio::AppLaunchContext*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
   46   //We use dynamic_cast<> in case of multiple inheritance.
   47 }
   48 
   49 } /* namespace Glib */
   50 
   51 
   52 namespace Gio
   53 {
   54 
   55 
   56 /* The *_Class implementation: */
   57 
   58 const Glib::Class& AppLaunchContext_Class::init()
   59 {
   60   if(!gtype_) // create the GType if necessary
   61   {
   62     // Glib::Class has to know the class init function to clone custom types.
   63     class_init_func_ = &AppLaunchContext_Class::class_init_function;
   64 
   65     // This is actually just optimized away, apparently with no harm.
   66     // Make sure that the parent type has been created.
   67     //CppClassParent::CppObjectType::get_type();
   68 
   69     // Create the wrapper type, with the same class/instance size as the base type.
   70     register_derived_type(g_app_launch_context_get_type());
   71 
   72     // Add derived versions of interfaces, if the C type implements any interfaces:
   73 
   74   }
   75 
   76   return *this;
   77 }
   78 
   79 
   80 void AppLaunchContext_Class::class_init_function(void* g_class, void* class_data)
   81 {
   82   const auto klass = static_cast<BaseClassType*>(g_class);
   83   CppClassParent::class_init_function(klass, class_data);
   84 
   85 
   86 }
   87 
   88 
   89 Glib::ObjectBase* AppLaunchContext_Class::wrap_new(GObject* object)
   90 {
   91   return new AppLaunchContext((GAppLaunchContext*)object);
   92 }
   93 
   94 
   95 /* The implementation: */
   96 
   97 GAppLaunchContext* AppLaunchContext::gobj_copy()
   98 {
   99   reference();
  100   return gobj();
  101 }
  102 
  103 AppLaunchContext::AppLaunchContext(const Glib::ConstructParams& construct_params)
  104 :
  105   Glib::Object(construct_params)
  106 {
  107 
  108 }
  109 
  110 AppLaunchContext::AppLaunchContext(GAppLaunchContext* castitem)
  111 :
  112   Glib::Object((GObject*)(castitem))
  113 {}
  114 
  115 
  116 AppLaunchContext::AppLaunchContext(AppLaunchContext&& src) noexcept
  117 : Glib::Object(std::move(src))
  118 {}
  119 
  120 AppLaunchContext& AppLaunchContext::operator=(AppLaunchContext&& src) noexcept
  121 {
  122   Glib::Object::operator=(std::move(src));
  123   return *this;
  124 }
  125 
  126 
  127 AppLaunchContext::~AppLaunchContext() noexcept
  128 {}
  129 
  130 
  131 AppLaunchContext::CppClassType AppLaunchContext::applaunchcontext_class_; // initialize static member
  132 
  133 GType AppLaunchContext::get_type()
  134 {
  135   return applaunchcontext_class_.init().get_type();
  136 }
  137 
  138 
  139 GType AppLaunchContext::get_base_type()
  140 {
  141   return g_app_launch_context_get_type();
  142 }
  143 
  144 
  145 AppLaunchContext::AppLaunchContext()
  146 :
  147   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  148   Glib::ObjectBase(nullptr),
  149   Glib::Object(Glib::ConstructParams(applaunchcontext_class_.init()))
  150 {
  151   
  152 
  153 }
  154 
  155 Glib::RefPtr<AppLaunchContext> AppLaunchContext::create()
  156 {
  157   return Glib::make_refptr_for_instance<AppLaunchContext>( new AppLaunchContext() );
  158 }
  159 
  160 void AppLaunchContext::setenv(const Glib::ustring& variable, const Glib::ustring& value)
  161 {
  162   g_app_launch_context_setenv(gobj(), variable.c_str(), value.c_str());
  163 }
  164 
  165 void AppLaunchContext::unsetenv(const Glib::ustring& variable)
  166 {
  167   g_app_launch_context_unsetenv(gobj(), variable.c_str());
  168 }
  169 
  170 std::vector<Glib::ustring> AppLaunchContext::get_environment() const
  171 {
  172   return Glib::ArrayHandler<Glib::ustring>::array_to_vector(g_app_launch_context_get_environment(const_cast<GAppLaunchContext*>(gobj())), Glib::OWNERSHIP_DEEP);
  173 }
  174 
  175 std::string AppLaunchContext::get_display(const Glib::RefPtr<AppInfo>& info, const std::vector<Glib::RefPtr<Gio::File>>& files)
  176 {
  177   return Glib::convert_return_gchar_ptr_to_stdstring(g_app_launch_context_get_display(gobj(), Glib::unwrap(info), Glib::ListHandler<Glib::RefPtr<Gio::File>>::vector_to_list(files).data()));
  178 }
  179 
  180 std::string AppLaunchContext::get_startup_notify_id(const Glib::RefPtr<AppInfo>& info, const std::vector<Glib::RefPtr<Gio::File>>& files)
  181 {
  182   return Glib::convert_return_gchar_ptr_to_stdstring(g_app_launch_context_get_startup_notify_id(gobj(), Glib::unwrap(info), Glib::ListHandler<Glib::RefPtr<Gio::File>>::vector_to_list(files).data()));
  183 }
  184 
  185 void AppLaunchContext::launch_failed(const std::string& startup_notify_id)
  186 {
  187   g_app_launch_context_launch_failed(gobj(), startup_notify_id.c_str());
  188 }
  189 
  190 
  191 } // namespace Gio
  192 
  193