1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
---|
2 | /** |
---|
3 | * bonobo-stream-memory.h: Memory based stream |
---|
4 | * |
---|
5 | * Author: |
---|
6 | * Miguel de Icaza (miguel@gnu.org) |
---|
7 | * |
---|
8 | * Copyright 1999, 2000 Helix Code, Inc. |
---|
9 | */ |
---|
10 | #ifndef _BONOBO_STREAM_MEM_H_ |
---|
11 | #define _BONOBO_STREAM_MEM_H_ |
---|
12 | |
---|
13 | #include <bonobo/bonobo-stream.h> |
---|
14 | |
---|
15 | BEGIN_GNOME_DECLS |
---|
16 | |
---|
17 | struct _BonoboStreamMem; |
---|
18 | typedef struct _BonoboStreamMem BonoboStreamMem; |
---|
19 | typedef struct _BonoboStreamMemPrivate BonoboStreamMemPrivate; |
---|
20 | |
---|
21 | #ifndef _BONOBO_STORAGE_MEM_H_ |
---|
22 | struct _BonoboStorageMem; |
---|
23 | typedef struct _BonoboStorageMem BonoboStorageMem; |
---|
24 | #endif |
---|
25 | |
---|
26 | #define BONOBO_STREAM_MEM_TYPE (bonobo_stream_mem_get_type ()) |
---|
27 | #define BONOBO_STREAM_MEM(o) (GTK_CHECK_CAST ((o), BONOBO_STREAM_MEM_TYPE, BonoboStreamMem)) |
---|
28 | #define BONOBO_STREAM_MEM_CLASS(k) (GTK_CHECK_CLASS_CAST((k), BONOBO_STREAM_MEM_TYPE, BonoboStreamMemClass)) |
---|
29 | #define BONOBO_IS_STREAM_MEM(o) (GTK_CHECK_TYPE ((o), BONOBO_STREAM_MEM_TYPE)) |
---|
30 | #define BONOBO_IS_STREAM_MEM_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), BONOBO_STREAM_MEM_TYPE)) |
---|
31 | |
---|
32 | struct _BonoboStreamMem { |
---|
33 | BonoboStream stream; |
---|
34 | |
---|
35 | char *buffer; |
---|
36 | size_t size; |
---|
37 | long pos; |
---|
38 | gboolean read_only; |
---|
39 | gboolean resizable; |
---|
40 | char *content_type; |
---|
41 | char *name; |
---|
42 | |
---|
43 | BonoboStreamMemPrivate *priv; |
---|
44 | }; |
---|
45 | |
---|
46 | typedef struct { |
---|
47 | BonoboStreamClass parent_class; |
---|
48 | char *(*get_buffer) (BonoboStreamMem *stream_mem); |
---|
49 | size_t (*get_size) (BonoboStreamMem *stream_mem); |
---|
50 | } BonoboStreamMemClass; |
---|
51 | |
---|
52 | GtkType bonobo_stream_mem_get_type (void); |
---|
53 | BonoboStreamMem *bonobo_stream_mem_construct (BonoboStreamMem *stream_mem, |
---|
54 | Bonobo_Stream corba_stream, |
---|
55 | const char *buffer, |
---|
56 | size_t size, |
---|
57 | gboolean read_only, |
---|
58 | gboolean resizable); |
---|
59 | |
---|
60 | BonoboStream *bonobo_stream_mem_create (const char *buffer, |
---|
61 | size_t size, |
---|
62 | gboolean read_only, |
---|
63 | gboolean resizable); |
---|
64 | |
---|
65 | const char *bonobo_stream_mem_get_buffer (BonoboStreamMem *stream_mem); |
---|
66 | size_t bonobo_stream_mem_get_size (BonoboStreamMem *stream_mem); |
---|
67 | |
---|
68 | END_GNOME_DECLS |
---|
69 | |
---|
70 | #endif /* _BONOBO_STREAM_MEM_H_ */ |
---|