// Generated by gtkmmproc -- DO NOT MODIFY! #include #include // -*- c++ -*- /* $Id: listener.ccg,v 1.2 2002/04/22 00:26:22 murrayc Exp $ */ /* * * Copyright 1998-1999 The Gtk-- Development Team * Copyright 2001 Free Software Foundation * * 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. */ namespace Gnome { namespace Bonobo { namespace Servers { } //namespace Servers } //namespace Bonobo } //namespace Gnome namespace { } // anonymous namespace namespace Glib { Glib::RefPtr wrap(BonoboListener* object, bool take_copy /* = false */) { return Glib::RefPtr( dynamic_cast (Glib::wrap_auto ((GObject*)(object), take_copy)) ); //We use dynamic_cast<> in case of multiple inheritance. } } /* namespace Glib */ namespace Gnome { namespace Bonobo { namespace Servers { /* The *_Class implementation: */ const Glib::Class& Listener_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_ = &Listener_Class::class_init_function; // TODO: This is currently just optimized away, apparently with no harm. // Is it actually necessary? // 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(bonobo_listener_get_type()); // Add derived versions of interfaces, if the C type implements any interfaces: } return *this; } void Listener_Class::class_init_function(void* g_class, void* class_data) { BaseClassType *const klass = static_cast(g_class); CppClassParent::class_init_function(klass, class_data); } Glib::ObjectBase* Listener_Class::wrap_new(GObject* o) { return new Listener((BonoboListener*)(o)); } /* The implementation: */ BonoboListener* Listener::gobj_copy() { reference(); return gobj(); } Glib::RefPtr Listener::wrap_specific_type(BonoboListener* gobject, bool take_copy /* = false */) //static { Glib::RefPtr refPtr; if(gobject) { //Check for an existing wrapper: Listener* pCppObject = dynamic_cast(Glib::ObjectBase::_get_current_wrapper(G_OBJECT(gobject))); if(pCppObject) { //Return the existing wrapper: refPtr = Glib::RefPtr(pCppObject); } else { //Create a new wrapper: refPtr = Glib::RefPtr( new Listener(gobject) ); } if(take_copy && refPtr) refPtr->reference(); } return refPtr; } Listener::Listener(BonoboListener* castitem) : Unknown_CImpl((BonoboObject*)(castitem)) { //Get a client reference: //Use the C++ mapping from now on because it is simpler. corbaref_ = ::Bonobo::Listener::_orbitcpp_wrap( BONOBO_OBJREF(gobject_) ); } Listener::~Listener() { } Listener::CppClassType Listener::listener_class_; // initialize static member GType Listener::get_type() { return listener_class_.init().get_type(); } GType Listener::get_base_type() { return bonobo_listener_get_type(); } void Listener::event(char const * event_name, const CORBA::Any & args) throw(CORBA::SystemException) { return corbaref_->event(event_name, args); } void Listener::unImplemented() throw(CORBA::SystemException) { return corbaref_->unImplemented(); } void Listener::unImplemented2() throw(CORBA::SystemException) { return corbaref_->unImplemented2(); } } // namespace Servers } // namespace Bonobo } // namespace Gnome