1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
---|
2 | /** |
---|
3 | * bonobo-running-context.c: An interface to track running objects |
---|
4 | * |
---|
5 | * Author: |
---|
6 | * Michael Meeks (michael@helixcode.com) |
---|
7 | * |
---|
8 | * Copyright (C) 2000, Helix Code, Inc. |
---|
9 | */ |
---|
10 | #ifndef _BONOBO_RUNNING_CONTEXT_H_ |
---|
11 | #define _BONOBO_RUNNING_CONTEXT_H_ |
---|
12 | |
---|
13 | #include <bonobo/bonobo-xobject.h> |
---|
14 | |
---|
15 | BEGIN_GNOME_DECLS |
---|
16 | |
---|
17 | typedef struct _BonoboRunningContextPrivate BonoboRunningContextPrivate; |
---|
18 | |
---|
19 | typedef struct { |
---|
20 | BonoboXObject parent; |
---|
21 | |
---|
22 | BonoboRunningContextPrivate *priv; |
---|
23 | } BonoboRunningContext; |
---|
24 | |
---|
25 | typedef struct { |
---|
26 | BonoboXObjectClass parent; |
---|
27 | |
---|
28 | POA_Bonobo_RunningContext__epv epv; |
---|
29 | |
---|
30 | void (*last_unref) (void); |
---|
31 | } BonoboRunningContextClass; |
---|
32 | |
---|
33 | GtkType bonobo_running_context_get_type (void); |
---|
34 | BonoboObject *bonobo_running_context_new (void); |
---|
35 | |
---|
36 | /* |
---|
37 | * This interface is private, and purely for speed |
---|
38 | * of impl. of the context. |
---|
39 | */ |
---|
40 | void bonobo_running_context_add_object (CORBA_Object object); |
---|
41 | void bonobo_running_context_remove_object (CORBA_Object object); |
---|
42 | void bonobo_running_context_ignore_object (CORBA_Object object); |
---|
43 | void bonobo_running_context_trace_objects (CORBA_Object object, |
---|
44 | const char *fn, |
---|
45 | int line, |
---|
46 | int mode); |
---|
47 | void bonobo_running_context_at_exit_unref (CORBA_Object object); |
---|
48 | |
---|
49 | #ifdef BONOBO_OBJECT_DEBUG |
---|
50 | # define bonobo_running_context_add_object(o) G_STMT_START{bonobo_running_context_trace_objects((o),G_GNUC_PRETTY_FUNCTION,__LINE__,0);}G_STMT_END |
---|
51 | # define bonobo_running_context_remove_object(o) G_STMT_START{bonobo_running_context_trace_objects((o),G_GNUC_PRETTY_FUNCTION,__LINE__,1);}G_STMT_END |
---|
52 | # define bonobo_running_context_ignore_object(o) G_STMT_START{bonobo_running_context_trace_objects((o),G_GNUC_PRETTY_FUNCTION,__LINE__,2);}G_STMT_END |
---|
53 | #endif |
---|
54 | |
---|
55 | END_GNOME_DECLS |
---|
56 | |
---|
57 | #endif /* _BONOBO_RUNNING_CONTEXT_H_ */ |
---|
58 | |
---|