2 * Copyright (C) 2007 Pekka Lampila <pekka.lampila@iki.fi>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301 USA
24 #include "swfdec_as_internal.h"
25 #include "swfdec_as_strings.h"
26 #include "swfdec_debug.h"
28 SWFDEC_AS_NATIVE (2204, 0, swfdec_file_reference_browse
)
30 swfdec_file_reference_browse (SwfdecAsContext
*cx
, SwfdecAsObject
*object
,
31 guint argc
, SwfdecAsValue
*argv
, SwfdecAsValue
*ret
)
33 SWFDEC_STUB ("FileReference.browse");
36 SWFDEC_AS_NATIVE (2204, 1, swfdec_file_reference_upload
)
38 swfdec_file_reference_upload (SwfdecAsContext
*cx
, SwfdecAsObject
*object
,
39 guint argc
, SwfdecAsValue
*argv
, SwfdecAsValue
*ret
)
41 SWFDEC_STUB ("FileReference.upload");
44 SWFDEC_AS_NATIVE (2204, 2, swfdec_file_reference_download
)
46 swfdec_file_reference_download (SwfdecAsContext
*cx
, SwfdecAsObject
*object
,
47 guint argc
, SwfdecAsValue
*argv
, SwfdecAsValue
*ret
)
49 SWFDEC_STUB ("FileReference.download");
52 SWFDEC_AS_NATIVE (2204, 3, swfdec_file_reference_cancel
)
54 swfdec_file_reference_cancel (SwfdecAsContext
*cx
, SwfdecAsObject
*object
,
55 guint argc
, SwfdecAsValue
*argv
, SwfdecAsValue
*ret
)
57 SWFDEC_STUB ("FileReference.cancel");
61 swfdec_file_reference_get_creationDate (SwfdecAsContext
*cx
,
62 SwfdecAsObject
*object
, guint argc
, SwfdecAsValue
*argv
,
65 SWFDEC_STUB ("FileReference.creationDate (get)");
69 swfdec_file_reference_get_creator (SwfdecAsContext
*cx
, SwfdecAsObject
*object
,
70 guint argc
, SwfdecAsValue
*argv
, SwfdecAsValue
*ret
)
72 SWFDEC_STUB ("FileReference.creator (get)");
76 swfdec_file_reference_get_modificationDate (SwfdecAsContext
*cx
,
77 SwfdecAsObject
*object
, guint argc
, SwfdecAsValue
*argv
,
80 SWFDEC_STUB ("FileReference.modificationDate (get)");
84 swfdec_file_reference_get_name (SwfdecAsContext
*cx
, SwfdecAsObject
*object
,
85 guint argc
, SwfdecAsValue
*argv
, SwfdecAsValue
*ret
)
87 SWFDEC_STUB ("FileReference.name (get)");
91 swfdec_file_reference_get_size (SwfdecAsContext
*cx
, SwfdecAsObject
*object
,
92 guint argc
, SwfdecAsValue
*argv
, SwfdecAsValue
*ret
)
94 SWFDEC_STUB ("FileReference.size (get)");
98 swfdec_file_reference_get_type (SwfdecAsContext
*cx
, SwfdecAsObject
*object
,
99 guint argc
, SwfdecAsValue
*argv
, SwfdecAsValue
*ret
)
101 SWFDEC_STUB ("FileReference.type (get)");
104 // Note: this is not actually the flash.net.FileReference function, but is
105 // called from within that function
106 SWFDEC_AS_NATIVE (2204, 200, swfdec_file_reference_construct
)
108 swfdec_file_reference_construct (SwfdecAsContext
*cx
, SwfdecAsObject
*object
,
109 guint argc
, SwfdecAsValue
*argv
, SwfdecAsValue
*ret
)
111 SwfdecAsObject
*target
;
114 SWFDEC_STUB ("FileReference");
116 if (argc
> 0 && SWFDEC_AS_VALUE_IS_COMPOSITE (&argv
[0])) {
117 target
= SWFDEC_AS_VALUE_GET_COMPOSITE (&argv
[0]);
124 swfdec_as_object_add_native_variable (target
, SWFDEC_AS_STR_creationDate
,
125 swfdec_file_reference_get_creationDate
, NULL
);
126 swfdec_as_object_add_native_variable (target
, SWFDEC_AS_STR_creator
,
127 swfdec_file_reference_get_creator
, NULL
);
128 swfdec_as_object_add_native_variable (target
, SWFDEC_AS_STR_modificationDate
,
129 swfdec_file_reference_get_modificationDate
, NULL
);
130 swfdec_as_object_add_native_variable (target
, SWFDEC_AS_STR_name
,
131 swfdec_file_reference_get_name
, NULL
);
132 swfdec_as_object_add_native_variable (target
, SWFDEC_AS_STR_size
,
133 swfdec_file_reference_get_size
, NULL
);
134 swfdec_as_object_add_native_variable (target
, SWFDEC_AS_STR_type
,
135 swfdec_file_reference_get_type
, NULL
);
137 SWFDEC_AS_VALUE_SET_STRING (&val
, SWFDEC_AS_STR_undefined
);
138 swfdec_as_object_set_variable (target
, SWFDEC_AS_STR_postData
, &val
);