static void fusion_tls_output_stream_class_init (FusionTLSOutputStreamClass * klass) { fusion_tls_output_stream_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (FusionTLSOutputStreamPrivate)); G_OUTPUT_STREAM_CLASS (klass)->write_fn = fusion_tls_output_stream_real_write; G_OUTPUT_STREAM_CLASS (klass)->write_async = fusion_tls_output_stream_real_write_async; G_OUTPUT_STREAM_CLASS (klass)->write_finish = fusion_tls_output_stream_real_write_finish; G_OUTPUT_STREAM_CLASS (klass)->close_fn = fusion_tls_output_stream_real_close; G_OBJECT_CLASS (klass)->finalize = fusion_tls_output_stream_finalize; }
static void g_filter_output_stream_class_init (GFilterOutputStreamClass *klass) { GObjectClass *object_class; GOutputStreamClass *ostream_class; object_class = G_OBJECT_CLASS (klass); object_class->get_property = g_filter_output_stream_get_property; object_class->set_property = g_filter_output_stream_set_property; object_class->dispose = g_filter_output_stream_dispose; ostream_class = G_OUTPUT_STREAM_CLASS (klass); ostream_class->write_fn = g_filter_output_stream_write; ostream_class->flush = g_filter_output_stream_flush; ostream_class->close_fn = g_filter_output_stream_close; ostream_class->write_async = g_filter_output_stream_write_async; ostream_class->write_finish = g_filter_output_stream_write_finish; ostream_class->flush_async = g_filter_output_stream_flush_async; ostream_class->flush_finish = g_filter_output_stream_flush_finish; ostream_class->close_async = g_filter_output_stream_close_async; ostream_class->close_finish = g_filter_output_stream_close_finish; g_object_class_install_property (object_class, PROP_BASE_STREAM, g_param_spec_object ("base-stream", P_("The Filter Base Stream"), P_("The underlying base stream the io ops will be done on"), G_TYPE_OUTPUT_STREAM, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB)); }
static gboolean my_slow_close_output_stream_close_finish (GOutputStream *stream, GAsyncResult *result, GError **error) { return G_OUTPUT_STREAM_CLASS (my_slow_close_output_stream_parent_class)-> close_finish (stream, result, error); }
static gboolean my_slow_close_output_stream_close (GOutputStream *stream, GCancellable *cancellable, GError **error) { g_usleep (CLOSE_TIME_MS * 1000); return G_OUTPUT_STREAM_CLASS (my_slow_close_output_stream_parent_class)-> close_fn (stream, cancellable, error); }
static void my_slow_close_output_stream_class_init (MySlowCloseOutputStreamClass *klass) { GOutputStreamClass *ostream_class; ostream_class = G_OUTPUT_STREAM_CLASS (klass); ostream_class->close_fn = my_slow_close_output_stream_close; ostream_class->close_async = my_slow_close_output_stream_close_async; ostream_class->close_finish = my_slow_close_output_stream_close_finish; }
static gboolean delayed_close_cb (gpointer data) { DelayedClose *df = data; G_OUTPUT_STREAM_CLASS (my_slow_close_output_stream_parent_class)-> close_async (df->stream, df->io_priority, df->cancellable, df->callback, df->user_data); return FALSE; }
static void g_tls_output_stream_gnutls_class_init (GTlsOutputStreamGnutlsClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GOutputStreamClass *output_stream_class = G_OUTPUT_STREAM_CLASS (klass); g_type_class_add_private (klass, sizeof (GTlsOutputStreamGnutlsPrivate)); gobject_class->dispose = g_tls_output_stream_gnutls_dispose; output_stream_class->write_fn = g_tls_output_stream_gnutls_write; output_stream_class->write_async = g_tls_output_stream_gnutls_write_async; output_stream_class->write_finish = g_tls_output_stream_gnutls_write_finish; }
static void g_unix_output_stream_class_init (GUnixOutputStreamClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GOutputStreamClass *stream_class = G_OUTPUT_STREAM_CLASS (klass); g_type_class_add_private (klass, sizeof (GUnixOutputStreamPrivate)); gobject_class->get_property = g_unix_output_stream_get_property; gobject_class->set_property = g_unix_output_stream_set_property; gobject_class->finalize = g_unix_output_stream_finalize; stream_class->write_fn = g_unix_output_stream_write; stream_class->close_fn = g_unix_output_stream_close; stream_class->write_async = g_unix_output_stream_write_async; stream_class->write_finish = g_unix_output_stream_write_finish; stream_class->close_async = g_unix_output_stream_close_async; stream_class->close_finish = g_unix_output_stream_close_finish; /** * GUnixOutputStream:fd: * * The file descriptor that the stream writes to. * * Since: 2.20 */ g_object_class_install_property (gobject_class, PROP_FD, g_param_spec_int ("fd", P_("File descriptor"), P_("The file descriptor to write to"), G_MININT, G_MAXINT, -1, G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); /** * GUnixOutputStream:close-fd: * * Whether to close the file descriptor when the stream is closed. * * Since: 2.20 */ g_object_class_install_property (gobject_class, PROP_CLOSE_FD, g_param_spec_boolean ("close-fd", P_("Close file descriptor"), P_("Whether to close the file descriptor when the stream is closed"), TRUE, G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); }
static void g_unix_output_stream_class_init (GUnixOutputStreamClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GOutputStreamClass *stream_class = G_OUTPUT_STREAM_CLASS (klass); g_type_class_add_private (klass, sizeof (GUnixOutputStreamPrivate)); gobject_class->finalize = g_unix_output_stream_finalize; stream_class->write_fn = g_unix_output_stream_write; stream_class->close_fn = g_unix_output_stream_close; stream_class->write_async = g_unix_output_stream_write_async; stream_class->write_finish = g_unix_output_stream_write_finish; stream_class->close_async = g_unix_output_stream_close_async; stream_class->close_finish = g_unix_output_stream_close_finish; }
static void gedit_document_output_stream_class_init (GeditDocumentOutputStreamClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GOutputStreamClass *stream_class = G_OUTPUT_STREAM_CLASS (klass); object_class->get_property = gedit_document_output_stream_get_property; object_class->set_property = gedit_document_output_stream_set_property; object_class->dispose = gedit_document_output_stream_dispose; object_class->finalize = gedit_document_output_stream_finalize; object_class->constructed = gedit_document_output_stream_constructed; stream_class->write_fn = gedit_document_output_stream_write; stream_class->close_fn = gedit_document_output_stream_close; stream_class->flush = gedit_document_output_stream_flush; g_object_class_install_property (object_class, PROP_DOCUMENT, g_param_spec_object ("document", "Document", "The document which is written", GEDIT_TYPE_DOCUMENT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); /** * GeditDocumentOutputStream:ensure-trailing-newline: * * The :ensure-trailing-newline property specifies whether or not to * ensure (enforce) the document ends with a trailing newline. */ g_object_class_install_property (object_class, PROP_ENSURE_TRAILING_NEWLINE, g_param_spec_boolean ("ensure-trailing-newline", "Ensure Trailing Newline", "Ensure the document ends with a trailing newline", TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB | G_PARAM_CONSTRUCT_ONLY)); g_type_class_add_private (object_class, sizeof (GeditDocumentOutputStreamPrivate)); }
static void g_win32_output_stream_class_init (GWin32OutputStreamClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GOutputStreamClass *stream_class = G_OUTPUT_STREAM_CLASS (klass); g_type_class_add_private (klass, sizeof (GWin32OutputStreamPrivate)); gobject_class->get_property = g_win32_output_stream_get_property; gobject_class->set_property = g_win32_output_stream_set_property; gobject_class->finalize = g_win32_output_stream_finalize; stream_class->write_fn = g_win32_output_stream_write; stream_class->close_fn = g_win32_output_stream_close; /** * GWin32OutputStream:handle: * * The file handle that the stream writes to. * * Since: 2.26 */ g_object_class_install_property (gobject_class, PROP_HANDLE, g_param_spec_pointer ("handle", P_("File handle"), P_("The file handle to write to"), G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); /** * GWin32OutputStream:close-handle: * * Whether to close the file handle when the stream is closed. * * Since: 2.26 */ g_object_class_install_property (gobject_class, PROP_CLOSE_HANDLE, g_param_spec_boolean ("close-handle", P_("Close file handle"), P_("Whether to close the file handle when the stream is closed"), TRUE, G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); }
static void g_local_file_output_stream_class_init (GLocalFileOutputStreamClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GOutputStreamClass *stream_class = G_OUTPUT_STREAM_CLASS (klass); GFileOutputStreamClass *file_stream_class = G_FILE_OUTPUT_STREAM_CLASS (klass); gobject_class->finalize = g_local_file_output_stream_finalize; stream_class->write_fn = g_local_file_output_stream_write; stream_class->close_fn = g_local_file_output_stream_close; file_stream_class->query_info = g_local_file_output_stream_query_info; file_stream_class->get_etag = g_local_file_output_stream_get_etag; file_stream_class->tell = g_local_file_output_stream_tell; file_stream_class->can_seek = g_local_file_output_stream_can_seek; file_stream_class->seek = g_local_file_output_stream_seek; file_stream_class->can_truncate = g_local_file_output_stream_can_truncate; file_stream_class->truncate_fn = g_local_file_output_stream_truncate; }
static void g_socket_output_stream_class_init (GSocketOutputStreamClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GOutputStreamClass *goutputstream_class = G_OUTPUT_STREAM_CLASS (klass); gobject_class->finalize = g_socket_output_stream_finalize; gobject_class->get_property = g_socket_output_stream_get_property; gobject_class->set_property = g_socket_output_stream_set_property; goutputstream_class->write_fn = g_socket_output_stream_write; goutputstream_class->writev_fn = g_socket_output_stream_writev; g_object_class_install_property (gobject_class, PROP_SOCKET, g_param_spec_object ("socket", P_("socket"), P_("The socket that this stream wraps"), G_TYPE_SOCKET, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); }
/* Output Stream */ static void nice_output_stream_class_init (NiceOutputStreamClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GOutputStreamClass *stream_class = G_OUTPUT_STREAM_CLASS (klass); g_type_class_add_private (klass, sizeof (NiceOutputStreamPrivate)); stream_class->write_fn = nice_output_stream_write; stream_class->close_fn = nice_output_stream_close; gobject_class->set_property = nice_output_stream_set_property; gobject_class->get_property = nice_output_stream_get_property; gobject_class->dispose = nice_output_stream_dispose; /*** * NiceOutputStream:agent: * * The #NiceAgent to wrap with an output stream. This must be an existing * reliable agent. * * A reference is not held on the #NiceAgent. If the agent is destroyed before * the #NiceOutputStream, %G_IO_ERROR_CLOSED will be returned for all * subsequent operations on the stream. * * Since: 0.1.5 */ g_object_class_install_property (gobject_class, PROP_AGENT, g_param_spec_object ("agent", "NiceAgent", "The underlying NiceAgent", NICE_TYPE_AGENT, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /*** * NiceOutputStream:stream-id: * * ID of the stream to use in the #NiceOutputStream:agent. * * Since: 0.1.5 */ g_object_class_install_property (gobject_class, PROP_STREAM_ID, g_param_spec_uint ( "stream-id", "Agent’s stream ID", "The ID of the agent’s stream to wrap.", 0, G_MAXUINT, 0, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /*** * NiceOutputStream:component-id: * * ID of the component to use in the #NiceOutputStream:agent. * * Since: 0.1.5 */ g_object_class_install_property (gobject_class, PROP_COMPONENT_ID, g_param_spec_uint ( "component-id", "Agent’s component ID", "The ID of the agent’s component to wrap.", 0, G_MAXUINT, 0, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); }