1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2
#include <bonobo/bonobo-foreign-object.h>
3
#include <bonobo/bonobo-exception.h>
4
#include <bonobo/bonobo-running-context.h>
7
bonobo_foreign_object_class_init (BonoboForeignObjectClass *klass)
12
bonobo_foreign_object_instance_init (GObject *g_object,
18
bonobo_foreign_object_get_type (void)
20
static GType type = 0;
24
sizeof (BonoboForeignObjectClass),
26
(GBaseFinalizeFunc) NULL,
27
(GClassInitFunc) bonobo_foreign_object_class_init,
28
NULL, /* class_finalize */
29
NULL, /* class_data */
30
sizeof (BonoboForeignObject),
32
(GInstanceInitFunc) bonobo_foreign_object_instance_init
35
type = g_type_register_static (BONOBO_TYPE_OBJECT, "BonoboForeignObject",
44
bonobo_foreign_object_new (CORBA_Object corba_objref)
47
CORBA_Environment ev[1];
49
g_return_val_if_fail (corba_objref != CORBA_OBJECT_NIL, NULL);
51
CORBA_exception_init (ev);
52
if (!CORBA_Object_is_a (corba_objref, "IDL:Bonobo/Unknown:1.0", ev)) {
53
if (ev->_major != CORBA_NO_EXCEPTION)
54
g_warning ("CORBA_Object_is_a: %s",
55
bonobo_exception_get_text (ev));
57
g_warning ("bonobo_foreign_object_new: corba_objref"
58
" doesn't have interface Bonobo::Unknown");
62
object = BONOBO_OBJECT (g_object_new (BONOBO_TYPE_FOREIGN_OBJECT, NULL));
63
object->corba_objref = CORBA_Object_duplicate (corba_objref, NULL);
64
bonobo_running_context_add_object_T (object->corba_objref);
66
CORBA_exception_free (ev);