Gnash  0.8.11dev
Classes | Namespaces | Macros | Functions
npapi/plugin.h File Reference
#include <X11/Xlib.h>
#include <X11/cursorfont.h>
#include <glib.h>
#include <string>
#include <map>
#include <vector>
#include <boost/format.hpp>
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include "pluginbase.h"
#include "pluginScriptObject.h"

Go to the source code of this file.

Classes

class  gnash::nsPluginInstance
 

Namespaces

 gnash
 Anonymous namespace for callbacks, local functions, event handlers etc.
 

Macros

#define dummystr(x)   # x
 
#define dummyestr(x)   dummystr(x)
 
#define __FUNCTION__   __FILE__ ":" dummyestr(__LINE__)
 
#define __PRETTY_FUNCTION__   __FUNCTION__
 
#define GNASH_PLUGIN_DEBUG   1
 
#define TOKENIZE_FORMAT(z, n, t)   % t##n
 
#define TOKENIZE_ARGS(z, n, t)   BOOST_PP_COMMA_IF(n) const T##n& t##n
 
#define LOG_TYPES   (error) (debug) (trace)
 
#define ARG_NUMBER   4
 
#define LOG_TEMPLATES(z, n, data)
 
#define GENERATE_LOG_TYPES(r, _, t)   BOOST_PP_REPEAT(ARG_NUMBER, LOG_TEMPLATES, t)
 

Functions

void gnash::processLog_error (const boost::format &fmt)
 
void gnash::processLog_debug (const boost::format &fmt)
 
void gnash::processLog_trace (const boost::format &fmt)
 

Macro Definition Documentation

§ __FUNCTION__

#define __FUNCTION__   __FILE__ ":" dummyestr(__LINE__)

§ __PRETTY_FUNCTION__

#define __PRETTY_FUNCTION__   __FUNCTION__

§ ARG_NUMBER

#define ARG_NUMBER   4

The preprocessor generates templates with 1..ARG_NUMBER arguments.

§ dummyestr

#define dummyestr (   x)    dummystr(x)

§ dummystr

#define dummystr (   x)    # x

§ GENERATE_LOG_TYPES

#define GENERATE_LOG_TYPES (   r,
  _,
 
)    BOOST_PP_REPEAT(ARG_NUMBER, LOG_TEMPLATES, t)

Calls the macro LOG_TEMPLATES an ARG_NUMBER number of times, each time adding an extra typename argument to the template.

§ GNASH_PLUGIN_DEBUG

#define GNASH_PLUGIN_DEBUG   1

§ LOG_TEMPLATES

#define LOG_TEMPLATES (   z,
  n,
  data 
)
Value:
template<BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n), typename T)>\
inline void log_##data(BOOST_PP_REPEAT(BOOST_PP_INC(n), TOKENIZE_ARGS, t)) \
{\
if (GNASH_PLUGIN_DEBUG < 1) return; \
boost::format f(t0); \
using namespace boost::io; \
f.exceptions(all_error_bits ^ (too_many_args_bit | \
too_few_args_bit | \
bad_format_string_bit)); \
processLog_##data(f BOOST_PP_REPEAT_FROM_TO(1, \
BOOST_PP_INC(n), \
TOKENIZE_FORMAT, t));\
}
Definition: gui.h:74
#define TOKENIZE_ARGS(z, n, t)
Definition: npapi/plugin.h:177
SimpleBuffer data
Definition: LocalConnection_as.cpp:151
Definition: GnashKey.h:152
Definition: GnashKey.h:160
Definition: GnashKey.h:166
#define GNASH_PLUGIN_DEBUG
Definition: npapi/plugin.h:157

§ LOG_TYPES

#define LOG_TYPES   (error) (debug) (trace)

This is a sequence of different log message types to be used in the code. Append the name to log_ to call the function, e.g. log_error, log_unimpl.

§ TOKENIZE_ARGS

#define TOKENIZE_ARGS (   z,
  n,
 
)    BOOST_PP_COMMA_IF(n) const T##n& t##n

Macro to add a number of arguments to the templated function corresponding to the number of template arguments. Produces code like this: "const T0& t0, const T1& t1, const T2& t2 ..."

§ TOKENIZE_FORMAT

#define TOKENIZE_FORMAT (   z,
  n,
 
)    % t##n

This heap of steaming preprocessor code magically converts printf-style statements into boost::format messages using templates. Macro to feed boost::format strings to the boost::format object, producing code like this: "% t1 % t2 % t3 ..."