Fix few bugs in SwfdecGtkSocket that made it unusable
[swfdec.git] / swfdec / swfdec_load_object.h
blobc44c9bed4c0a8fd7af090bafe01b3a679fd2e6c7
1 /* Swfdec
2 * Copyright (C) 2007-2008 Benjamin Otte <otte@gnome.org>
3 * 2007 Pekka Lampila <pekka.lampila@iki.fi>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301 USA
21 #ifndef _SWFDEC_LOAD_OBJECT_H_
22 #define _SWFDEC_LOAD_OBJECT_H_
24 #include <swfdec/swfdec.h>
25 #include <swfdec/swfdec_as_object.h>
26 #include <swfdec/swfdec_resource.h>
28 G_BEGIN_DECLS
31 typedef struct _SwfdecLoadObject SwfdecLoadObject;
32 typedef struct _SwfdecLoadObjectClass SwfdecLoadObjectClass;
34 typedef void (* SwfdecLoadObjectProgress) (SwfdecAsObject *target,
35 glong loaded, glong size);
36 typedef void (* SwfdecLoadObjectFinish) (SwfdecAsObject *target,
37 const char *text);
39 #define SWFDEC_TYPE_LOAD_OBJECT (swfdec_load_object_get_type())
40 #define SWFDEC_IS_LOAD_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_LOAD_OBJECT))
41 #define SWFDEC_IS_LOAD_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_LOAD_OBJECT))
42 #define SWFDEC_LOAD_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_LOAD_OBJECT, SwfdecLoadObject))
43 #define SWFDEC_LOAD_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_LOAD_OBJECT, SwfdecLoadObjectClass))
44 #define SWFDEC_LOAD_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_LOAD_OBJECT, SwfdecLoadObjectClass))
46 struct _SwfdecLoadObject {
47 GObject object;
49 const char * url; /* GC'ed url to request */
50 SwfdecBuffer * buffer; /* data to send */
51 guint header_count; /* number of headers */
52 char ** header_names; /* names of headers */
53 char ** header_values; /* values of headers */
54 SwfdecLoader * loader; /* loader when loading or NULL */
56 SwfdecSandbox * sandbox; /* sandbox that inited the loading */
57 guint version; /* version used when initiating the load - for parsing the data */
58 SwfdecAsObject * target; /* target object */
59 SwfdecLoadObjectProgress progress; /* progress callback */
60 SwfdecLoadObjectFinish finish; /* finish callback */
63 struct _SwfdecLoadObjectClass {
64 GObjectClass object_class;
67 GType swfdec_load_object_get_type (void);
69 void swfdec_load_object_create (SwfdecAsObject * target,
70 const char * url,
71 SwfdecBuffer * data,
72 guint header_count,
73 char ** header_names,
74 char ** header_values,
75 SwfdecLoadObjectProgress progress,
76 SwfdecLoadObjectFinish finish);
79 G_END_DECLS
80 #endif