Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GNASH_EXTERNALINTERFACE_H
00022 #define GNASH_EXTERNALINTERFACE_H
00023
00024 #include <string>
00025 #include <vector>
00026 #include <map>
00027 #include <boost/shared_ptr.hpp>
00028
00029 #include "dsodefs.h"
00030
00031 namespace gnash {
00032
00033 class as_object;
00034 class as_value;
00035 struct ObjectURI;
00036 class Global_as;
00037 class movie_root;
00038 class IOChannel;
00039 }
00040
00041 namespace gnash {
00042
00043 struct DSOEXPORT ExternalInterface
00044 {
00045 typedef struct DSOLOCAL {
00046 std::string name;
00047 std::string type;
00048 std::vector<as_value> args;
00049 } invoke_t;
00050
00051
00052
00053
00054
00056 DSOEXPORT static std::string toXML(const as_value &obj);
00057
00059 DSOEXPORT static as_value toAS(Global_as& as, const std::string &xml);
00060
00062 DSOEXPORT static std::map<std::string, as_value> propertiesToAS(Global_as& gl,
00063 std::string &xml);
00064
00065 DSOEXPORT static as_value argumentsToXML(std::vector<as_value> &args);
00066
00067
00068 DSOEXPORT static std::string objectToXML(as_object *obj);
00069 DSOEXPORT static as_value objectToAS(Global_as& gl, const std::string &xml);
00070
00071
00072
00073 DSOEXPORT static std::string arrayToXML(as_object *obj);
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085 static std::string escapeXML(as_object &obj);
00086 static std::string unescapeXML(as_object &obj);
00087
00088 static as_value parseXML(const std::string &xml);
00089 static std::vector<as_value> parseArguments(const std::string &xml);
00090
00091
00092 static boost::shared_ptr<invoke_t> parseInvoke(const std::string &str);
00093
00094 DSOEXPORT static boost::shared_ptr<invoke_t> ExternalEventCheck(int fd);
00095
00096
00097
00098 DSOEXPORT static std::string makeInvoke (const std::string &method,
00099 const std::vector<as_value> &args);
00100
00101 static std::string makeNull ();
00102 static std::string makeTrue ();
00103 static std::string makeFalse ();
00104 static std::string makeString (const std::string &str);
00105 static std::string makeProperty (const std::string &str, const std::string &data);
00106 static std::string makeProperty (const std::string &str, double num);
00107 static std::string makeProperty (const std::string &str, int num);
00108 static std::string makeNumber (double num);
00109 static std::string makeNumber (int num);
00110 static std::string makeNumber (unsigned int num);
00111 static std::string makeArray (std::vector<std::string> &args);
00112 static std::string makeObject (std::map<std::string, std::string> &args);
00113
00114 DSOEXPORT static size_t writeBrowser(int fd, const std::string &xml);
00115 DSOEXPORT static std::string readBrowser(int fd);
00116 };
00117
00118 }
00119
00120
00121 #endif
00122
00123
00124
00125
00126