File: bonobo-progressive.h

package info (click to toggle)
bonobo 1.0.22-2.2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 13,412 kB
  • ctags: 5,445
  • sloc: ansic: 51,714; sh: 7,733; makefile: 1,425; yacc: 318; xml: 266; sed: 16
file content (89 lines) | stat: -rw-r--r-- 3,381 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/**
 * Bonobo::ProgressiveDataSink
 *
 * Author:
 *   Nat Friedman (nat@nat.org)
 *
 * Copyright 1999 Helix Code, Inc.
 */
#ifndef _BONOBO_PROGRESSIVE_DATA_SINK_H_
#define _BONOBO_PROGRESSIVE_DATA_SINK_H_

#include <bonobo/bonobo-xobject.h>

BEGIN_GNOME_DECLS

#define BONOBO_PROGRESSIVE_DATA_SINK_TYPE        (bonobo_progressive_data_sink_get_type ())
#define BONOBO_PROGRESSIVE_DATA_SINK(o)          (GTK_CHECK_CAST ((o), BONOBO_PROGRESSIVE_DATA_SINK_TYPE, BonoboProgressiveDataSink))
#define BONOBO_PROGRESSIVE_DATA_SINK_CLASS(k)    (GTK_CHECK_CLASS_CAST((k), BONOBO_PROGRESSIVE_DATA_SINK_TYPE, BonoboProgressiveDataSinkClass))
#define BONOBO_IS_PROGRESSIVE_DATA_SINK(o)       (GTK_CHECK_TYPE ((o), BONOBO_PROGRESSIVE_DATA_SINK_TYPE))
#define BONOBO_IS_PROGRESSIVE_DATA_SINK_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), BONOBO_PROGRESSIVE_DATA_SINK_TYPE))

typedef struct _BonoboProgressiveDataSink BonoboProgressiveDataSink;
typedef struct _BonoboProgressiveDataSinkPrivate BonoboProgressiveDataSinkPrivate;

/* Callback typedefs. */
typedef int (*BonoboProgressiveDataSinkStartFn)   (BonoboProgressiveDataSink *psink,
						  void *closure);

typedef int (*BonoboProgressiveDataSinkEndFn)     (BonoboProgressiveDataSink *psink, void *closure);

typedef int (*BonoboProgressiveDataSinkAddDataFn) (BonoboProgressiveDataSink *psink,
						  const Bonobo_ProgressiveDataSink_iobuf *buffer,
						  void *closure);

typedef int (*BonoboProgressiveDataSinkSetSizeFn) (BonoboProgressiveDataSink *psink,
						  const CORBA_long count, void *closure);

struct _BonoboProgressiveDataSink {
	BonoboXObject object;

	/*
	 * These are the callbacks the user can set.  If we use the
	 * default class methods, then these are NULL.
	 */
	BonoboProgressiveDataSinkStartFn start_fn;
	BonoboProgressiveDataSinkEndFn end_fn;
	BonoboProgressiveDataSinkAddDataFn add_data_fn;
	BonoboProgressiveDataSinkSetSizeFn set_size_fn;

	void *closure;

	BonoboProgressiveDataSinkPrivate *priv;
};

typedef struct {
	BonoboXObjectClass parent_class;

	POA_Bonobo_ProgressiveDataSink__epv epv;

	/* Methods. */
	int (*start_fn)    (BonoboProgressiveDataSink *psink);
	int (*end_fn)      (BonoboProgressiveDataSink *psink);
	int (*add_data_fn) (BonoboProgressiveDataSink *psink,
			    const Bonobo_ProgressiveDataSink_iobuf *buffer);
	int (*set_size_fn) (BonoboProgressiveDataSink *psink,
			    const CORBA_long count);
			 
} BonoboProgressiveDataSinkClass;

GtkType		           bonobo_progressive_data_sink_get_type        (void);

BonoboProgressiveDataSink *bonobo_progressive_data_sink_new		(BonoboProgressiveDataSinkStartFn   start_fn,
									 BonoboProgressiveDataSinkEndFn     end_fn,
									 BonoboProgressiveDataSinkAddDataFn add_data_fn,
									 BonoboProgressiveDataSinkSetSizeFn set_size_fn,
									 void                              *closure);

BonoboProgressiveDataSink *bonobo_progressive_data_sink_construct       (BonoboProgressiveDataSink         *psink,
									 BonoboProgressiveDataSinkStartFn   start_fn,
									 BonoboProgressiveDataSinkEndFn     end_fn,
									 BonoboProgressiveDataSinkAddDataFn add_data_fn,
									 BonoboProgressiveDataSinkSetSizeFn set_size_fn,
									 void                              *closure);
							       
END_GNOME_DECLS

#endif /* _BONOBO_PROGRESSIVE_DATA_SINK_H_ */