diff options
author | Padraig O'Briain <padraigo@src.gnome.org> | 2001-06-06 08:38:01 +0000 |
---|---|---|
committer | Padraig O'Briain <padraigo@src.gnome.org> | 2001-06-06 08:38:01 +0000 |
commit | ca1ced1f82e664dd60ccd6ca29789b77c872ced7 (patch) | |
tree | 33f364a1c07839709f07c625340be0dbff27d421 /atk/atkstreamablecontent.c | |
parent | 807252808936f0bbff97842bcdd71685bc48b79e (diff) | |
download | atk-ca1ced1f82e664dd60ccd6ca29789b77c872ced7.tar.gz |
atk/Makefile.am, atk/atk.h Updated comments
* New files atk/atkstreamablecontent.[ch]
Updated files: atk/Makefile.am, atk/atk.h
* atk/atkvalue.c: Updated comments
Diffstat (limited to 'atk/atkstreamablecontent.c')
-rwxr-xr-x | atk/atkstreamablecontent.c | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/atk/atkstreamablecontent.c b/atk/atkstreamablecontent.c new file mode 100755 index 0000000..676ca7c --- /dev/null +++ b/atk/atkstreamablecontent.c @@ -0,0 +1,121 @@ +/* ATK - Accessibility Toolkit + * Copyright 2001 Sun Microsystems Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "atkstreamablecontent.h" + +GType +atk_streamable_content_get_type () +{ + static GType type = 0; + + if (!type) { + GTypeInfo tinfo = + { + sizeof (AtkStreamableContentIface), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + + }; + + type = g_type_register_static (G_TYPE_INTERFACE, "AtkStreamableContent", &tinfo, 0); + } + + return type; +} + +/** + * atk_streamable_content_get_n_mime_types: + * @obj: a GObject instance that implements AtkStreamableContentIface + * + * Gets the number of mime types supported by this object. + * + * Returns: a gint which is the number of mime types supported by the object. + **/ +gint +atk_streamable_content_get_n_mime_types (AtkStreamableContent *obj) +{ + AtkStreamableContentIface *iface; + + g_return_val_if_fail (obj != NULL, 0); + g_return_val_if_fail (ATK_IS_STREAMABLE_CONTENT (obj), 0); + + iface = ATK_STREAMABLE_CONTENT_GET_IFACE (obj); + + if (iface->get_n_mime_types) + return (iface->get_n_mime_types) (obj); + else + return 0; +} + +/** + * atk_streamable_content_get_mime_type: + * @obj: a GObject instance that implements AtkStreamableContent + * @i: a gint representing the position of the mime type starting from 0 + * + * Gets the character string of the specified mime type. The first mime + * type is at position 0, the second at position1, and so on. + * + * Returns : a gchar* respresenting the specified mime type; the caller + * should not free the character string. + **/ +G_CONST_RETURN gchar* +atk_streamable_content_get_mime_type (AtkStreamableContent *obj, + gint i) +{ + AtkStreamableContentIface *iface; + + g_return_val_if_fail (obj != NULL, NULL); + g_return_val_if_fail (i >= 0, NULL); + g_return_val_if_fail (ATK_IS_STREAMABLE_CONTENT (obj), NULL); + + iface = ATK_STREAMABLE_CONTENT_GET_IFACE (obj); + + if (iface->get_mime_type) + return (iface->get_mime_type) (obj, i); + else + return NULL; +} + +/** + * atk_streamable_content_get_stream: + * @obj: a GObject instance that implements AtkStreamableContentIface + * @mime_type: a gchar* representing the mime type + * + * Gets the content in the specified mime type + * + * Returns: A #GIOChannel which contains the content in the specified mime + * type. + **/ +GIOChannel* +atk_streamable_content_get_stream (AtkStreamableContent *obj, + const gchar *mime_type) +{ + AtkStreamableContentIface *iface; + + g_return_val_if_fail (obj != NULL, NULL); + g_return_val_if_fail (mime_type != NULL, NULL); + g_return_val_if_fail (ATK_IS_STREAMABLE_CONTENT (obj), NULL); + + iface = ATK_STREAMABLE_CONTENT_GET_IFACE (obj); + + if (iface->get_stream) + return (iface->get_stream) (obj, mime_type); + else + return NULL; +} |