1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
---|
2 | /* |
---|
3 | * bonobo-transient.h: a transient object implementation. |
---|
4 | * |
---|
5 | * This simplifies the creation of POA managers for transient objects. |
---|
6 | * Objects living in this POA are created on demand and destroyed after use. |
---|
7 | * |
---|
8 | * Authors: |
---|
9 | * Nat Friedman (nat@helixcode.com) |
---|
10 | * Miguel de Icaza (miguel@helixcode.com) |
---|
11 | * |
---|
12 | * I just refactored the code from the original PropertyBag, all the smart hacks |
---|
13 | * are from Nat -mig. |
---|
14 | * |
---|
15 | * (C) 2000 Helix Code, Inc. |
---|
16 | */ |
---|
17 | #ifndef _BONOBO_TRANSIENT_H_ |
---|
18 | #define _BONOBO_TRANSIENT_H_ |
---|
19 | |
---|
20 | #include <libgnome/gnome-defs.h> |
---|
21 | #include <gtk/gtkobject.h> |
---|
22 | #include <bonobo/Bonobo.h> |
---|
23 | |
---|
24 | BEGIN_GNOME_DECLS |
---|
25 | |
---|
26 | #define BONOBO_TRANSIENT_TYPE (bonobo_transient_get_type ()) |
---|
27 | #define BONOBO_TRANSIENT(o) (GTK_CHECK_CAST ((o), BONOBO_TRANSIENT_TYPE, BonoboTransient)) |
---|
28 | #define BONOBO_TRANSIENT_CLASS(k) (GTK_CHECK_CLASS_CAST((k), BONOBO_TRANSIENT_TYPE, BonoboTransientClass)) |
---|
29 | #define BONOBO_IS_TRANSIENT(o) (GTK_CHECK_TYPE ((o), BONOBO_TRANSIENT_TYPE)) |
---|
30 | #define BONOBO_IS_TRANSIENT_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), BONOBO_TRANSIENT_TYPE)) |
---|
31 | |
---|
32 | typedef struct _BonoboTransientPriv BonoboTransientPriv; |
---|
33 | |
---|
34 | typedef struct { |
---|
35 | GtkObject parent; |
---|
36 | |
---|
37 | BonoboTransientPriv *priv; |
---|
38 | } BonoboTransient; |
---|
39 | |
---|
40 | typedef struct { |
---|
41 | GtkObjectClass parent_class; |
---|
42 | } BonoboTransientClass; |
---|
43 | |
---|
44 | /* |
---|
45 | * Signature for incarnating servants in the BonoboTransient |
---|
46 | */ |
---|
47 | typedef PortableServer_Servant (*BonoboTransientServantNew) (PortableServer_POA, BonoboTransient *, char *name, void *data); |
---|
48 | |
---|
49 | /* |
---|
50 | * Signature for destroying servants created by BonoboTransientServantNew functions |
---|
51 | */ |
---|
52 | typedef void (*BonoboTransientServantDestroy) (PortableServer_Servant servant, void *data); |
---|
53 | |
---|
54 | BonoboTransient *bonobo_transient_new (PortableServer_POA poa, |
---|
55 | BonoboTransientServantNew new_servant, |
---|
56 | BonoboTransientServantDestroy destroy_servant, |
---|
57 | void *data); |
---|
58 | BonoboTransient *bonobo_transient_construct (BonoboTransient *transient, |
---|
59 | PortableServer_POA poa, |
---|
60 | BonoboTransientServantNew new_servant, |
---|
61 | BonoboTransientServantDestroy destroy_servant, |
---|
62 | gpointer data); |
---|
63 | |
---|
64 | CORBA_Object bonobo_transient_create_objref (BonoboTransient *transient, |
---|
65 | const char *iface_name, |
---|
66 | const char *name, |
---|
67 | CORBA_Environment *ev); |
---|
68 | |
---|
69 | GtkType bonobo_transient_get_type (void); |
---|
70 | |
---|
71 | END_GNOME_DECLS |
---|
72 | |
---|
73 | #endif /* _BONOBO_TRANSIENT_H_ */ |
---|
74 | |
---|
75 | |
---|
76 | |
---|