• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

external.h

Go to the documentation of this file.
00001 // 
00002 //   Copyright (C) 2010 Free Software Foundation, Inc
00003 // 
00004 // This program is free software; you can redistribute it and/or modify
00005 // it under the terms of the GNU General Public License as published by
00006 // the Free Software Foundation; either version 3 of the License, or
00007 // (at your option) any later version.
00008 // 
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with this program; if not, write to the Free Software
00016 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00017 //
00018 
00019 #ifndef GNASH_PLUGIN_EXTERNAL_H
00020 #define GNASH_PLUGIN_EXTERNAL_H
00021 
00022 #ifdef HAVE_CONFIG_H
00023 #include "gnashconfig.h"
00024 #endif
00025 
00026 #include <string>
00027 #include <sstream>
00028 #include <vector>
00029 #include <map>
00030 
00031 #include "npapi.h"
00032 #include "npruntime.h"
00033 
00034 #include "GnashNPVariant.h"
00035 
00036 namespace gnash {
00037 
00038 struct ExternalInterface
00039 {
00040     typedef struct {
00041         std::string name;
00042         std::string type;
00043         std::vector<GnashNPVariant> args;
00044     } invoke_t;
00045     
00046     // Create an Invoke message for the standalone Gnash
00047     static std::string makeInvoke (const std::string &method, std::vector<std::string> args);
00048     
00049     static std::string makeNull ();
00050     static std::string makeTrue ();
00051     static std::string makeFalse ();
00052     static std::string makeString (const std::string &str);
00053     static std::string makeProperty (const std::string &str, const std::string &data);
00054     static std::string makeProperty (const std::string &str, double num);
00055     static std::string makeProperty (const std::string &str, int num);
00056     static std::string makeNumber (double num);
00057     static std::string makeNumber (int num);
00058     static std::string makeNumber (unsigned int num);
00059     static std::string makeArray (std::vector<std::string> &args);
00060     static std::string makeObject (std::map<std::string, std::string> &args);
00061     
00062     static GnashNPVariant parseXML(const std::string &xml);
00063     static invoke_t *parseInvoke(const std::string &xml);
00064     
00065     static std::map<std::string, GnashNPVariant> parseProperties(const std::string &xml);
00066     static std::vector<GnashNPVariant> parseArguments(const std::string &xml);
00067     static std::string convertNPVariant (const NPVariant *npv);
00068 };
00069 
00070 }
00071 
00072 #endif // GNASH_PLUGIN_EXTERNAL_H
00073 
00074 // local Variables:
00075 // mode: C++
00076 // indent-tabs-mode: nil
00077 // End:

Generated on Thu Sep 30 2010 14:34:58 for Gnash by  doxygen 1.7.1