1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
---|
2 | /* |
---|
3 | * bonobo-listener.h: Generic listener interface for callbacks. |
---|
4 | * |
---|
5 | * Authors: |
---|
6 | * Alex Graveley (alex@helixcode.com) |
---|
7 | * Mike Kestner (mkestner@ameritech.net) |
---|
8 | * |
---|
9 | * Copyright (C) 2000, Helix Code, Inc. |
---|
10 | */ |
---|
11 | #ifndef _BONOBO_LISTENER_H_ |
---|
12 | #define _BONOBO_LISTENER_H_ |
---|
13 | |
---|
14 | #include <bonobo/bonobo-arg.h> |
---|
15 | #include <bonobo/bonobo-xobject.h> |
---|
16 | |
---|
17 | BEGIN_GNOME_DECLS |
---|
18 | |
---|
19 | #define BONOBO_LISTENER_TYPE (bonobo_listener_get_type ()) |
---|
20 | #define BONOBO_LISTENER(o) (GTK_CHECK_CAST ((o), BONOBO_LISTENER_TYPE, BonoboListener)) |
---|
21 | #define BONOBO_LISTENER_CLASS(k) (GTK_CHECK_CLASS_CAST((k), BONOBO_LISTENER_TYPE, BonoboListenerClass)) |
---|
22 | #define BONOBO_IS_LISTENER(o) (GTK_CHECK_TYPE ((o), BONOBO_LISTENER_TYPE)) |
---|
23 | #define BONOBO_IS_LISTENER_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), BONOBO_LISTENER_TYPE)) |
---|
24 | |
---|
25 | typedef struct _BonoboListenerPrivate BonoboListenerPrivate; |
---|
26 | |
---|
27 | typedef struct { |
---|
28 | BonoboXObject parent; |
---|
29 | |
---|
30 | BonoboListenerPrivate *priv; |
---|
31 | } BonoboListener; |
---|
32 | |
---|
33 | typedef struct { |
---|
34 | BonoboXObjectClass parent_class; |
---|
35 | |
---|
36 | POA_Bonobo_Listener__epv epv; |
---|
37 | |
---|
38 | /* Signals */ |
---|
39 | void (* event_notify) (BonoboListener *listener, |
---|
40 | char *event_name, |
---|
41 | BonoboArg *event_data, |
---|
42 | CORBA_Environment *ev); |
---|
43 | } BonoboListenerClass; |
---|
44 | |
---|
45 | |
---|
46 | typedef void (*BonoboListenerCallbackFn) (BonoboListener *listener, |
---|
47 | char *event_name, |
---|
48 | CORBA_any *any, |
---|
49 | CORBA_Environment *ev, |
---|
50 | gpointer user_data); |
---|
51 | |
---|
52 | GtkType bonobo_listener_get_type (void); |
---|
53 | |
---|
54 | BonoboListener *bonobo_listener_new (BonoboListenerCallbackFn event_callback, |
---|
55 | gpointer user_data); |
---|
56 | |
---|
57 | char *bonobo_event_make_name (const char *idl_path, |
---|
58 | const char *kind, |
---|
59 | const char *subtype); |
---|
60 | |
---|
61 | char *bonobo_event_type (const char *event_name); |
---|
62 | char *bonobo_event_subtype (const char *event_name); |
---|
63 | char *bonobo_event_kind (const char *event_name); |
---|
64 | char *bonobo_event_idl_path (const char *event_name); |
---|
65 | |
---|
66 | END_GNOME_DECLS |
---|
67 | |
---|
68 | #endif /* _BONOBO_LISTENER_H_ */ |
---|
69 | |
---|