gio-strigi r4 - trunk/src
- From: pvanhoof svn gnome org
- To: svn-commits-list gnome org
- Subject: gio-strigi r4 - trunk/src
- Date: Thu, 26 Feb 2009 22:42:45 +0000 (UTC)
Author: pvanhoof
Date: Thu Feb 26 22:42:45 2009
New Revision: 4
URL: http://svn.gnome.org/viewvc/gio-strigi?rev=4&view=rev
Log:
Operate on Strigi::Stream instead of on Strigi::BufferedStream
Added:
trunk/src/strigi-stream.cpp
- copied, changed from r3, /trunk/src/strigi-buffered-stream.cpp
trunk/src/strigi-stream.h
- copied, changed from r3, /trunk/src/strigi-buffered-stream.h
Removed:
trunk/src/strigi-buffered-stream.cpp
trunk/src/strigi-buffered-stream.h
Modified:
trunk/src/Makefile.am
Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am (original)
+++ trunk/src/Makefile.am Thu Feb 26 22:42:45 2009
@@ -7,11 +7,11 @@
include_HEADERS = \
strigi-gio-inputstream.h \
- strigi-buffered-stream.h
+ strigi-stream.h
libgio_strigi_la_SOURCES = $(include_HEADERS) \
strigi-gio-inputstream.cpp \
- strigi-buffered-stream.cpp
+ strigi-stream.cpp
libgio_strigi_la_LDFLAGS = -version-info 0:0:0
Copied: trunk/src/strigi-stream.cpp (from r3, /trunk/src/strigi-buffered-stream.cpp)
==============================================================================
--- /trunk/src/strigi-buffered-stream.cpp (original)
+++ trunk/src/strigi-stream.cpp Thu Feb 26 22:42:45 2009
@@ -21,10 +21,10 @@
#include <strigi/bufferedstream.h>
-#include "strigi-buffered-stream.h"
+#include "strigi-stream.h"
-G_DEFINE_TYPE (StrigiBufferedStream, strigi_buffered_stream, G_TYPE_INPUT_STREAM);
+G_DEFINE_TYPE (StrigiStream, strigi_stream, G_TYPE_INPUT_STREAM);
enum
{
@@ -32,9 +32,9 @@
PROP_CPPOBJ
};
-struct _StrigiBufferedStreamPrivate
+struct _StrigiStreamPrivate
{
- Strigi::BufferedInputStream *cppobj;
+ Strigi::InputStream *cppobj;
/* pending operation metadata */
GSimpleAsyncResult *result;
GCancellable *cancellable;
@@ -45,12 +45,12 @@
};
static void
-strigi_buffered_stream_get_property (GObject *object,
+strigi_stream_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
- StrigiBufferedStream *stream = STRIGI_BUFFERED_STREAM (object);
+ StrigiStream *stream = STRIGI_STREAM (object);
switch (prop_id)
{
@@ -64,17 +64,17 @@
}
static void
-strigi_buffered_stream_set_property (GObject *object,
+strigi_stream_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
- StrigiBufferedStream *stream = STRIGI_BUFFERED_STREAM (object);
+ StrigiStream *stream = STRIGI_STREAM (object);
switch (prop_id)
{
case PROP_CPPOBJ:
- stream->priv->cppobj = (Strigi::BufferedInputStream *) g_value_get_pointer (value);
+ stream->priv->cppobj = (Strigi::InputStream *) g_value_get_pointer (value);
break;
default:
@@ -83,38 +83,38 @@
}
static void
-strigi_buffered_stream_finalize (GObject *object)
+strigi_stream_finalize (GObject *object)
{
- StrigiBufferedStream *stream = STRIGI_BUFFERED_STREAM (object);
+ StrigiStream *stream = STRIGI_STREAM (object);
if (stream->priv->cppobj)
delete stream->priv->cppobj;
g_mutex_free (stream->priv->lock);
- if (G_OBJECT_CLASS (strigi_buffered_stream_parent_class)->finalize)
- (*G_OBJECT_CLASS (strigi_buffered_stream_parent_class)->finalize) (object);
+ if (G_OBJECT_CLASS (strigi_stream_parent_class)->finalize)
+ (*G_OBJECT_CLASS (strigi_stream_parent_class)->finalize) (object);
}
static gssize
-cpp_read (StrigiBufferedStream *stream,
+cpp_read (StrigiStream *stream,
void *buffer, gsize count,
GCancellable *cancellable, GError **error)
{
- Strigi::BufferedInputStream *cppobj = stream->priv->cppobj;
+ Strigi::InputStream *cppobj = stream->priv->cppobj;
const char* d;
int32_t n = cppobj->read(d, stream->priv->pos, count);
stream->priv->pos += n;
}
static gssize
-strigi_buffered_stream_read (GInputStream *stream,
+strigi_stream_read (GInputStream *stream,
void *buffer,
gsize count,
GCancellable *cancellable,
GError **error)
{
- StrigiBufferedStream *input_stream = STRIGI_BUFFERED_STREAM (stream);
+ StrigiStream *input_stream = STRIGI_STREAM (stream);
gssize ret;
g_mutex_lock (input_stream->priv->lock);
@@ -125,9 +125,9 @@
}
static gpointer
-strigi_buffered_stream_read_ready (gpointer data)
+strigi_stream_read_ready (gpointer data)
{
- StrigiBufferedStream *stream = (StrigiBufferedStream *) data;
+ StrigiStream *stream = (StrigiStream *) data;
GSimpleAsyncResult *simple;
GError *error = NULL;
@@ -167,7 +167,7 @@
static void
-strigi_buffered_stream_read_async (GInputStream *stream,
+strigi_stream_read_async (GInputStream *stream,
void *buffer,
gsize count,
gint io_priority,
@@ -175,14 +175,14 @@
GAsyncReadyCallback callback,
gpointer user_data)
{
- StrigiBufferedStream *input_stream = STRIGI_BUFFERED_STREAM (stream);
+ StrigiStream *input_stream = STRIGI_STREAM (stream);
GThread *thread;
g_assert (input_stream->priv->result == NULL);
input_stream->priv->result =
g_simple_async_result_new (G_OBJECT (stream), callback, user_data,
- (gpointer) strigi_buffered_stream_read_ready);
+ (gpointer) strigi_stream_read_ready);
if (cancellable)
g_object_ref (cancellable);
@@ -191,25 +191,25 @@
input_stream->priv->buffer = buffer;
input_stream->priv->count = count;
- thread = g_thread_create (strigi_buffered_stream_read_ready,
+ thread = g_thread_create (strigi_stream_read_ready,
stream,
FALSE, NULL);
}
static gssize
-strigi_buffered_stream_read_finish (GInputStream *stream,
+strigi_stream_read_finish (GInputStream *stream,
GAsyncResult *result,
GError **error)
{
GSimpleAsyncResult *simple;
gssize count;
- g_return_val_if_fail (STRIGI_IS_BUFFERED_STREAM (stream), -1);
+ g_return_val_if_fail (STRIGI_IS_STREAM (stream), -1);
simple = G_SIMPLE_ASYNC_RESULT (result);
- g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == strigi_buffered_stream_read_async);
+ g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == strigi_stream_read_async);
count = g_simple_async_result_get_op_res_gssize (simple);
@@ -217,20 +217,20 @@
}
static void
-strigi_buffered_stream_class_init (StrigiBufferedStreamClass *klass)
+strigi_stream_class_init (StrigiStreamClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GInputStreamClass *ginputstream_class = G_INPUT_STREAM_CLASS (klass);
- g_type_class_add_private (klass, sizeof (StrigiBufferedStreamPrivate));
+ g_type_class_add_private (klass, sizeof (StrigiStreamPrivate));
- gobject_class->finalize = strigi_buffered_stream_finalize;
- gobject_class->get_property = strigi_buffered_stream_get_property;
- gobject_class->set_property = strigi_buffered_stream_set_property;
-
- ginputstream_class->read_fn = strigi_buffered_stream_read;
- ginputstream_class->read_async = strigi_buffered_stream_read_async;
- ginputstream_class->read_finish = strigi_buffered_stream_read_finish;
+ gobject_class->finalize = strigi_stream_finalize;
+ gobject_class->get_property = strigi_stream_get_property;
+ gobject_class->set_property = strigi_stream_set_property;
+
+ ginputstream_class->read_fn = strigi_stream_read;
+ ginputstream_class->read_async = strigi_stream_read_async;
+ ginputstream_class->read_finish = strigi_stream_read_finish;
g_object_class_install_property (gobject_class, PROP_CPPOBJ,
g_param_spec_pointer ("cppobj", "cppobj",
@@ -240,14 +240,14 @@
}
static void
-strigi_buffered_stream_init (StrigiBufferedStream *stream)
+strigi_stream_init (StrigiStream *stream)
{
- stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, STRIGI_TYPE_BUFFERED_STREAM, StrigiBufferedStreamPrivate);
+ stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, STRIGI_TYPE_STREAM, StrigiStreamPrivate);
stream->priv->lock = g_mutex_new ();
}
GInputStream*
-strigi_buffered_stream_new (void *cppobj)
+strigi_stream_new (void *cppobj)
{
- return G_INPUT_STREAM (g_object_new (STRIGI_TYPE_BUFFERED_STREAM, "cppobj", cppobj, NULL));
+ return G_INPUT_STREAM (g_object_new (STRIGI_TYPE_STREAM, "cppobj", cppobj, NULL));
}
Copied: trunk/src/strigi-stream.h (from r3, /trunk/src/strigi-buffered-stream.h)
==============================================================================
--- /trunk/src/strigi-buffered-stream.h (original)
+++ trunk/src/strigi-stream.h Thu Feb 26 22:42:45 2009
@@ -11,42 +11,42 @@
*
*/
-#ifndef _strigibufferedstream_h_
-#define _strigibufferedstream_h_
+#ifndef _strigistream_h_
+#define _strigistream_h_
#include <gio/gio.h>
G_BEGIN_DECLS
-#define STRIGI_TYPE_BUFFERED_STREAM (strigi_buffered_stream_get_type ())
-#define STRIGI_BUFFERED_STREAM(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
- STRIGI_TYPE_BUFFERED_STREAM, StrigiBufferedStream))
-#define STRIGI_BUFFERED_STREAM_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
- STRIGI_TYPE_BUFFERED_STREAM, StrigiBufferedStreamClass))
-#define STRIGI_IS_BUFFERED_STREAM(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
- STRIGI_TYPE_BUFFERED_STREAM))
-#define STRIGI_IS_BUFFERED_STREAM_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
- STRIGI_TYPE_BUFFERED_STREAM))
-#define STRIGI_BUFFERED_STREAM_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
- STRIGI_TYPE_BUFFERED_STREAM, StrigiBufferedStreamClass))
-
-typedef struct _StrigiBufferedStreamPrivate StrigiBufferedStreamPrivate;
-typedef struct _StrigiBufferedStreamClass StrigiBufferedStreamClass;
-typedef struct _StrigiBufferedStream StrigiBufferedStream;
+#define STRIGI_TYPE_STREAM (strigi_stream_get_type ())
+#define STRIGI_STREAM(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ STRIGI_TYPE_STREAM, StrigiStream))
+#define STRIGI_STREAM_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
+ STRIGI_TYPE_STREAM, StrigiStreamClass))
+#define STRIGI_IS_STREAM(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ STRIGI_TYPE_STREAM))
+#define STRIGI_IS_STREAM_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
+ STRIGI_TYPE_STREAM))
+#define STRIGI_STREAM_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
+ STRIGI_TYPE_STREAM, StrigiStreamClass))
+
+typedef struct _StrigiStreamPrivate StrigiStreamPrivate;
+typedef struct _StrigiStreamClass StrigiStreamClass;
+typedef struct _StrigiStream StrigiStream;
-struct _StrigiBufferedStreamClass
+struct _StrigiStreamClass
{
GInputStreamClass parent_class;
};
-struct _StrigiBufferedStream
+struct _StrigiStream
{
GInputStream parent_instance;
- StrigiBufferedStreamPrivate *priv;
+ StrigiStreamPrivate *priv;
};
-GType strigi_buffered_stream_get_type (void);
-GInputStream* strigi_buffered_stream_new (void *cppobj);
+GType strigi_stream_get_type (void);
+GInputStream* strigi_stream_new (void *cppobj);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]