20 #ifndef GNASH_PLUGIN_H 21 #define GNASH_PLUGIN_H 29 # define dummystr(x) # x 30 # define dummyestr(x) dummystr(x) 31 # define __FUNCTION__ __FILE__ ":" dummyestr(__LINE__) 33 # define __FUNCTION__ __func__ 37 #ifndef HAVE_PRETTY_FUNCTION 38 # define __PRETTY_FUNCTION__ __FUNCTION__ 44 #include <X11/cursorfont.h> 49 #include <boost/format.hpp> 50 #include <boost/preprocessor/arithmetic/inc.hpp> 51 #include <boost/preprocessor/repetition/enum_params.hpp> 52 #include <boost/preprocessor/repetition/repeat.hpp> 53 #include <boost/preprocessor/repetition/repeat_from_to.hpp> 54 #include <boost/preprocessor/seq/for_each.hpp> 56 #include "pluginbase.h" 70 NPBool
init(NPWindow *aWindow);
74 NPError
GetValue(NPPVariable variable,
void *value);
78 NPError
NewStream(NPMIMEType
type, NPStream *stream, NPBool seekable,
85 int32_t
Write(NPStream *stream, int32_t offset, int32_t len,
void *buffer);
93 std::vector<std::string> getCmdLine(
int hostfd,
int controlfd);
95 void setupCookies(
const std::string& pageURL);
96 void setupProxy(
const std::string& pageURL);
99 std::string getDocumentProp(
const std::string& propname)
const;
101 static bool handlePlayerRequestsWrapper(GIOChannel* iochan, GIOCondition cond,
nsPluginInstance* plugin);
103 bool handlePlayerRequests(GIOChannel* iochan, GIOCondition cond);
110 void setupIOChannel(
int fd, GIOFunc handler, GIOCondition signals);
117 bool processPlayerRequest();
121 std::map<std::string, std::string> _params;
125 std::string _swf_url;
126 std::string _swf_file;
128 unsigned int _height;
129 std::map<std::string, std::string> _options;
146 std::string _requestbuf;
148 std::string getCurrentPageURL()
const;
157 #define GNASH_PLUGIN_DEBUG 1 172 #define TOKENIZE_FORMAT(z, n, t) % t##n 177 #define TOKENIZE_ARGS(z, n, t) BOOST_PP_COMMA_IF(n) const T##n& t##n 182 #define LOG_TYPES (error) (debug) (trace) 186 #define LOG_TEMPLATES(z, n, data)\ 187 template<BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n), typename T)>\ 188 inline void log_##data(BOOST_PP_REPEAT(BOOST_PP_INC(n), TOKENIZE_ARGS, t)) \ 190 if (GNASH_PLUGIN_DEBUG < 1) return; \ 191 boost::format f(t0); \ 192 using namespace boost::io; \ 193 f.exceptions(all_error_bits ^ (too_many_args_bit | \ 195 bad_format_string_bit)); \ 196 processLog_##data(f BOOST_PP_REPEAT_FROM_TO(1, \ 198 TOKENIZE_FORMAT, t));\ 204 #define GENERATE_LOG_TYPES(r, _, t) \ 205 BOOST_PP_REPEAT(ARG_NUMBER, LOG_TEMPLATES, t) void shut()
Shutdown an instantiated object.
Definition: npapi/plugin.cpp:575
const char * getEmbedURL() const
#define LOG_TYPES
Definition: npapi/plugin.h:182
NPBool plugInitialized
Definition: npapi/plugin.cpp:126
int32_t Write(NPStream *stream, int32_t offset, int32_t len, void *buffer)
Read the data stream from Mozilla/Firefox.
Definition: npapi/plugin.cpp:709
NPBool isInitialized()
Definition: npapi/plugin.h:71
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
type
Definition: GnashKey.h:329
Definition: npapi/plugin.h:63
Definition: pluginScriptObject.h:57
#define GENERATE_LOG_TYPES(r, _, t)
Definition: npapi/plugin.h:204
GnashPluginScriptObject * getScriptObject()
Definition: npapi/plugin.h:89
void processLog_trace(const boost::format &fmt)
Definition: log.cpp:119
#define _(String)
Definition: log.h:44
NPObject * getScriptableObject()
NPError SetWindow(NPWindow *aWindow)
Set the window to be used to render in.
Definition: npapi/plugin.cpp:596
void processLog_error(const boost::format &fmt)
Definition: log.cpp:176
#define DSOEXPORT
Definition: dsodefs.h:55
int32_t WriteReady(NPStream *stream)
Can the stream be written to yet ?
Definition: npapi/plugin.cpp:696
NPError GetValue(NPPVariable variable, void *value)
Definition: npapi/plugin.cpp:630
virtual ~nsPluginInstance()
Destructor.
Definition: npapi/plugin.cpp:495
void processLog_debug(const boost::format &fmt)
Definition: log.cpp:130
NPError NewStream(NPMIMEType type, NPStream *stream, NPBool seekable, uint16_t *stype)
Open a new stream. THis is called every time there is swf content.
Definition: npapi/plugin.cpp:658
NPBool init(NPWindow *aWindow)
Initialize an instance of the plugin object.
Definition: npapi/plugin.cpp:550
NPError DestroyStream(NPStream *stream, NPError reason)
Destroy the stream.
Definition: npapi/plugin.cpp:681
nsPluginInstance(nsPluginCreateData *)
Constructor.
Definition: npapi/plugin.cpp:430