1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
---|
2 | /** |
---|
3 | * Bonobo::ProgressiveDataSink |
---|
4 | * |
---|
5 | * Author: |
---|
6 | * Nat Friedman (nat@nat.org) |
---|
7 | * |
---|
8 | * Copyright 1999 Helix Code, Inc. |
---|
9 | */ |
---|
10 | #ifndef _BONOBO_PROGRESSIVE_DATA_SINK_H_ |
---|
11 | #define _BONOBO_PROGRESSIVE_DATA_SINK_H_ |
---|
12 | |
---|
13 | #include <bonobo/bonobo-xobject.h> |
---|
14 | |
---|
15 | BEGIN_GNOME_DECLS |
---|
16 | |
---|
17 | #define BONOBO_PROGRESSIVE_DATA_SINK_TYPE (bonobo_progressive_data_sink_get_type ()) |
---|
18 | #define BONOBO_PROGRESSIVE_DATA_SINK(o) (GTK_CHECK_CAST ((o), BONOBO_PROGRESSIVE_DATA_SINK_TYPE, BonoboProgressiveDataSink)) |
---|
19 | #define BONOBO_PROGRESSIVE_DATA_SINK_CLASS(k) (GTK_CHECK_CLASS_CAST((k), BONOBO_PROGRESSIVE_DATA_SINK_TYPE, BonoboProgressiveDataSinkClass)) |
---|
20 | #define BONOBO_IS_PROGRESSIVE_DATA_SINK(o) (GTK_CHECK_TYPE ((o), BONOBO_PROGRESSIVE_DATA_SINK_TYPE)) |
---|
21 | #define BONOBO_IS_PROGRESSIVE_DATA_SINK_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), BONOBO_PROGRESSIVE_DATA_SINK_TYPE)) |
---|
22 | |
---|
23 | typedef struct _BonoboProgressiveDataSink BonoboProgressiveDataSink; |
---|
24 | typedef struct _BonoboProgressiveDataSinkPrivate BonoboProgressiveDataSinkPrivate; |
---|
25 | |
---|
26 | /* Callback typedefs. */ |
---|
27 | typedef int (*BonoboProgressiveDataSinkStartFn) (BonoboProgressiveDataSink *psink, |
---|
28 | void *closure); |
---|
29 | |
---|
30 | typedef int (*BonoboProgressiveDataSinkEndFn) (BonoboProgressiveDataSink *psink, void *closure); |
---|
31 | |
---|
32 | typedef int (*BonoboProgressiveDataSinkAddDataFn) (BonoboProgressiveDataSink *psink, |
---|
33 | const Bonobo_ProgressiveDataSink_iobuf *buffer, |
---|
34 | void *closure); |
---|
35 | |
---|
36 | typedef int (*BonoboProgressiveDataSinkSetSizeFn) (BonoboProgressiveDataSink *psink, |
---|
37 | const CORBA_long count, void *closure); |
---|
38 | |
---|
39 | struct _BonoboProgressiveDataSink { |
---|
40 | BonoboXObject object; |
---|
41 | |
---|
42 | /* |
---|
43 | * These are the callbacks the user can set. If we use the |
---|
44 | * default class methods, then these are NULL. |
---|
45 | */ |
---|
46 | BonoboProgressiveDataSinkStartFn start_fn; |
---|
47 | BonoboProgressiveDataSinkEndFn end_fn; |
---|
48 | BonoboProgressiveDataSinkAddDataFn add_data_fn; |
---|
49 | BonoboProgressiveDataSinkSetSizeFn set_size_fn; |
---|
50 | |
---|
51 | void *closure; |
---|
52 | |
---|
53 | BonoboProgressiveDataSinkPrivate *priv; |
---|
54 | }; |
---|
55 | |
---|
56 | typedef struct { |
---|
57 | BonoboXObjectClass parent_class; |
---|
58 | |
---|
59 | POA_Bonobo_ProgressiveDataSink__epv epv; |
---|
60 | |
---|
61 | /* Methods. */ |
---|
62 | int (*start_fn) (BonoboProgressiveDataSink *psink); |
---|
63 | int (*end_fn) (BonoboProgressiveDataSink *psink); |
---|
64 | int (*add_data_fn) (BonoboProgressiveDataSink *psink, |
---|
65 | const Bonobo_ProgressiveDataSink_iobuf *buffer); |
---|
66 | int (*set_size_fn) (BonoboProgressiveDataSink *psink, |
---|
67 | const CORBA_long count); |
---|
68 | |
---|
69 | } BonoboProgressiveDataSinkClass; |
---|
70 | |
---|
71 | GtkType bonobo_progressive_data_sink_get_type (void); |
---|
72 | |
---|
73 | BonoboProgressiveDataSink *bonobo_progressive_data_sink_new (BonoboProgressiveDataSinkStartFn start_fn, |
---|
74 | BonoboProgressiveDataSinkEndFn end_fn, |
---|
75 | BonoboProgressiveDataSinkAddDataFn add_data_fn, |
---|
76 | BonoboProgressiveDataSinkSetSizeFn set_size_fn, |
---|
77 | void *closure); |
---|
78 | |
---|
79 | BonoboProgressiveDataSink *bonobo_progressive_data_sink_construct (BonoboProgressiveDataSink *psink, |
---|
80 | BonoboProgressiveDataSinkStartFn start_fn, |
---|
81 | BonoboProgressiveDataSinkEndFn end_fn, |
---|
82 | BonoboProgressiveDataSinkAddDataFn add_data_fn, |
---|
83 | BonoboProgressiveDataSinkSetSizeFn set_size_fn, |
---|
84 | void *closure); |
---|
85 | |
---|
86 | END_GNOME_DECLS |
---|
87 | |
---|
88 | #endif /* _BONOBO_PROGRESSIVE_DATA_SINK_H_ */ |
---|
89 | |
---|