From c823b2bf3165990a556d50990adf4da5cee95593 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 2 Nov 2012 15:36:19 +0000 Subject: commit Gem 0.93.3 from http://gem.iem.at/releases/0.93.3/Gem-0.93.3-W32-i686.zip svn path=/trunk/; revision=16521 --- .../noncvs/windows/extra/Gem/dev/Base/CPPExtern.h | 742 ++++++++++----------- .../noncvs/windows/extra/Gem/dev/Base/GemBase.h | 280 ++++---- .../noncvs/windows/extra/Gem/dev/Base/GemCache.h | 8 +- .../noncvs/windows/extra/Gem/dev/Base/GemContext.h | 114 ++-- .../windows/extra/Gem/dev/Base/GemContextData.h | 8 +- .../noncvs/windows/extra/Gem/dev/Base/GemEvent.h | 8 +- .../windows/extra/Gem/dev/Base/GemExportDef.h | 8 +- .../windows/extra/Gem/dev/Base/GemFuncUtil.h | 8 +- packages/noncvs/windows/extra/Gem/dev/Base/GemGL.h | 8 +- .../noncvs/windows/extra/Gem/dev/Base/GemGLBase.h | 46 +- .../noncvs/windows/extra/Gem/dev/Base/GemGLUtil.h | 8 +- .../noncvs/windows/extra/Gem/dev/Base/GemGluObj.h | 192 +++--- .../noncvs/windows/extra/Gem/dev/Base/GemLoaders.h | 8 +- .../noncvs/windows/extra/Gem/dev/Base/GemMan.h | 8 +- .../noncvs/windows/extra/Gem/dev/Base/GemMath.h | 8 +- .../noncvs/windows/extra/Gem/dev/Base/GemPBuffer.h | 8 +- .../windows/extra/Gem/dev/Base/GemPathBase.h | 148 ++-- .../windows/extra/Gem/dev/Base/GemPixConvert.h | 8 +- .../windows/extra/Gem/dev/Base/GemPixDualObj.h | 380 +++++------ .../windows/extra/Gem/dev/Base/GemPixImageLoad.h | 8 +- .../windows/extra/Gem/dev/Base/GemPixImageSave.h | 8 +- .../noncvs/windows/extra/Gem/dev/Base/GemPixObj.h | 284 ++++---- .../noncvs/windows/extra/Gem/dev/Base/GemPixPete.h | 8 +- .../noncvs/windows/extra/Gem/dev/Base/GemPixUtil.h | 8 +- .../noncvs/windows/extra/Gem/dev/Base/GemSIMD.h | 8 +- .../noncvs/windows/extra/Gem/dev/Base/GemShape.h | 288 ++++---- .../noncvs/windows/extra/Gem/dev/Base/GemState.h | 8 +- .../noncvs/windows/extra/Gem/dev/Base/GemVector.h | 8 +- .../noncvs/windows/extra/Gem/dev/Base/GemVersion.h | 8 +- .../noncvs/windows/extra/Gem/dev/Base/GemWindow.h | 416 ++++++------ .../noncvs/windows/extra/Gem/dev/Base/Matrix.h | 8 +- .../noncvs/windows/extra/Gem/dev/Base/TextBase.h | 462 ++++++------- 32 files changed, 1760 insertions(+), 1760 deletions(-) (limited to 'packages/noncvs/windows/extra/Gem/dev/Base') diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/CPPExtern.h b/packages/noncvs/windows/extra/Gem/dev/Base/CPPExtern.h index ec17c0e7..fe4ac051 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/CPPExtern.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/CPPExtern.h @@ -1,371 +1,371 @@ -/*----------------------------------------------------------------- -LOG - GEM - Graphics Environment for Multimedia - - The base class for all externs written in C++ - - Copyright (c) 1997-1999 Mark Danks. mark@danks.org - For information on usage and redistribution, and for a DISCLAIMER OF ALL - WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. - ------------------------------------------------------------------*/ - -#ifndef _INCLUDE__GEM_BASE_CPPEXTERN_H_ -#define _INCLUDE__GEM_BASE_CPPEXTERN_H_ - -#include "Gem/ExportDef.h" - -#include "Gem/RTE.h" -#include "Gem/Version.h" - -#include -#include - -class CPPExtern; - -/* forward declaration of a generic exception handler for GemExceptions */ -namespace gem { - GEM_EXTERN void catchGemException(const char*objname, const t_object*obj); -}; - -/*----------------------------------------------------------------- -------------------------------------------------------------------- -CLASS - Obj_header - - The obligatory object header - -DESCRIPTION - - This is in a separate struct to assure that when PD uses the - class, the t_object is the very first thing. If it were the - first thing in CPPExtern, then there could be problems with - the vtable. - ------------------------------------------------------------------*/ -struct GEM_EXTERN Obj_header -{ - ////////// - // The obligatory object header - t_object pd_obj; - - ////////// - // Our data structure - CPPExtern *data; - - // This has a dummy arg so that NT won't complain - void *operator new(size_t, void *location, void *dummy); -}; - -/*----------------------------------------------------------------- -------------------------------------------------------------------- -CLASS - CPPExtern - - The base class for all externs written in C++ - -DESCRIPTION - - Each extern which is written in C++ needs to use the #defines at the - end of this header file. Currently, the operator new(size_t) and - operator delete(void *) are not overridden. This will be a problem - when PD expects everything to fit in its memory space and control - all memory allocation. - - The define - - CPPEXTERN_HEADER(NEW_CLASS, PARENT_CLASS); - - should be somewhere in your header file. - One of the defines like - - CPPEXTERN_NEW(NEW_CLASS); - CPPEXTERN_NEW_WITH_TWO_ARGS(NEW_CLASS, t_floatarg, A_FLOAT, t_floatarg, A_FLOAT); - - should be the first thing in your implementation file. - NEW_CLASS is the name of your class and PARENT_CLASS is the - parent of your class. - ------------------------------------------------------------------*/ -class GEM_EXTERN CPPExtern -{ - public: - - ////////// - // Constructor - CPPExtern(void); - - ////////// - // The Pd header - t_object *x_obj; - - ////////// - // Destructor - virtual ~CPPExtern(void) = 0; - - ////////// - // Get the object's canvas - const t_canvas *getCanvas(void) const { return(m_canvas); } - - ////////// - // This is a holder - don't touch it - static t_object *m_holder; - - ////////// - // my name - static char *m_holdname; - t_symbol *m_objectname; - - protected: - - ////////// - // Creation callback - static void real_obj_setupCallback(t_class *) {} - - private: - - ////////// - // The canvas that the object is in - t_canvas *m_canvas; - - public: - // these call pd's print-functions, and eventually prepend the object's name - void startpost(const char*format, ...) const; - void post(const char*format, ...) const; - void endpost(void) const; - void verbose(const int level, const char*format, ...) const; - void error(const char*format, ...) const; /* internally uses pd_error() */ - - // searches for a file based on the parent abstraction's path - // wraps open_via_path() and canvas_makefilename() - // the full filename is returned - // if the file does not exist, it is constructed - std::string findFile(const std::string filename, const std::string ext) const; - std::string findFile(const std::string filename) const; - - private: - mutable bool m_endpost; /* internal state for startpost/post/endpost */ - static bool checkGemVersion(const int major, const int minor); - CPPExtern(const CPPExtern&); - virtual CPPExtern&operator=(const CPPExtern&); -}; - -//////////////////////////////////////// -// This should be used in the header -//////////////////////////////////////// - -#define CPPEXTERN_HEADER(NEW_CLASS, PARENT_CLASS) \ -public: \ -static void obj_freeCallback(void *data) \ -{ CPPExtern *mydata = ((Obj_header *)data)->data; delete mydata; \ - ((Obj_header *)data)->Obj_header::~Obj_header(); } \ -static void real_obj_setupCallback(t_class *classPtr) \ -{ PARENT_CLASS::real_obj_setupCallback(classPtr); \ - NEW_CLASS::obj_setupCallback(classPtr); } \ -private: \ -static inline NEW_CLASS *GetMyClass(void *data) {return((NEW_CLASS *)((Obj_header *)data)->data);} \ -static void obj_setupCallback(t_class *classPtr); - - -//////////////////////////////////////// -// This should be the first thing in the implementation file -//////////////////////////////////////// - -// -// NO ARGUMENTS -///////////////////////////////////////////////// -#define CPPEXTERN_NEW(NEW_CLASS) \ - REAL_NEW__CLASS(NEW_CLASS); \ - static void* create_ ## NEW_CLASS (void) \ - REAL_NEW__CREATE1(NEW_CLASS) \ - obj->data = new NEW_CLASS(); \ - REAL_NEW__CREATE2(NEW_CLASS) \ - REAL_NEW__SETUP1(NEW_CLASS) \ - REAL_NEW__SETUP2(NEW_CLASS) - -// -// ONE ARGUMENT -///////////////////////////////////////////////// -#define CPPEXTERN_NEW_WITH_ONE_ARG(NEW_CLASS, TYPE, PD_TYPE) \ - REAL_NEW__CLASS(NEW_CLASS); \ - static void* create_ ## NEW_CLASS (TYPE arg) \ - REAL_NEW__CREATE1(NEW_CLASS) \ - obj->data = new NEW_CLASS(arg); \ - REAL_NEW__CREATE2(NEW_CLASS) \ - REAL_NEW__SETUP1(NEW_CLASS) \ - PD_TYPE, \ - REAL_NEW__SETUP2(NEW_CLASS) - -// -// GIMME ARGUMENT -///////////////////////////////////////////////// -#define CPPEXTERN_NEW_WITH_GIMME(NEW_CLASS) \ - REAL_NEW__CLASS(NEW_CLASS); \ - static void* create_ ## NEW_CLASS (t_symbol*s, int argc, t_atom*argv) \ - REAL_NEW__CREATE1(NEW_CLASS) \ - obj->data = new NEW_CLASS(argc,argv); \ - REAL_NEW__CREATE2(NEW_CLASS) \ - REAL_NEW__SETUP1(NEW_CLASS) \ - A_GIMME, \ - REAL_NEW__SETUP2(NEW_CLASS) - -// -// TWO ARGUMENTS -///////////////////////////////////////////////// -#define CPPEXTERN_NEW_WITH_TWO_ARGS(NEW_CLASS, TYPE, PD_TYPE, TTWO, PD_TWO) \ - REAL_NEW__CLASS(NEW_CLASS); \ - static void* create_ ## NEW_CLASS (TYPE arg, TTWO arg2) \ - REAL_NEW__CREATE1(NEW_CLASS) \ - obj->data = new NEW_CLASS(arg, arg2); \ - REAL_NEW__CREATE2(NEW_CLASS) \ - REAL_NEW__SETUP1(NEW_CLASS) \ - PD_TYPE, PD_TWO, \ - REAL_NEW__SETUP2(NEW_CLASS) - -// -// THREE ARGUMENTS -///////////////////////////////////////////////// -#define CPPEXTERN_NEW_WITH_THREE_ARGS(NEW_CLASS, TYPE, PD_TYPE, TTWO, PD_TWO, TTHREE, PD_THREE) \ - REAL_NEW__CLASS(NEW_CLASS); \ - static void* create_ ## NEW_CLASS (TYPE arg, TTWO arg2, TTHREE arg3) \ - REAL_NEW__CREATE1(NEW_CLASS) \ - obj->data = new NEW_CLASS(arg, arg2, arg3); \ - REAL_NEW__CREATE2(NEW_CLASS) \ - REAL_NEW__SETUP1(NEW_CLASS) \ - PD_TYPE, PD_TWO, PD_THREE, \ - REAL_NEW__SETUP2(NEW_CLASS) - -// -// FOUR ARGUMENTS -///////////////////////////////////////////////// -#define CPPEXTERN_NEW_WITH_FOUR_ARGS(NEW_CLASS, TYPE, PD_TYPE, TTWO, PD_TWO, TTHREE, PD_THREE, TFOUR, PD_FOUR) \ - REAL_NEW__CLASS(NEW_CLASS); \ - static void* create_ ## NEW_CLASS (TYPE arg, TTWO arg2, TTHREE arg3, TFOUR arg4) \ - REAL_NEW__CREATE1(NEW_CLASS) \ - obj->data = new NEW_CLASS(arg, arg2, arg3, arg4); \ - REAL_NEW__CREATE2(NEW_CLASS) \ - REAL_NEW__SETUP1(NEW_CLASS) \ - PD_TYPE, PD_TWO, PD_THREE, PD_FOUR, \ - REAL_NEW__SETUP2(NEW_CLASS) - -// -// FIVE ARGUMENTS -///////////////////////////////////////////////// -#define CPPEXTERN_NEW_WITH_FIVE_ARGS(NEW_CLASS, TYPE, PD_TYPE, TTWO, PD_TWO, TTHREE, PD_THREE, TFOUR, PD_FOUR, TFIVE, PD_FIVE) \ - REAL_NEW__CLASS(NEW_CLASS); \ - static void* create_ ## NEW_CLASS (TYPE arg, TTWO arg2, TTHREE arg3, TFOUR arg4, TFIVE arg5) \ - REAL_NEW__CREATE1(NEW_CLASS) \ - obj->data = new NEW_CLASS(arg, arg2, arg3, arg4, arg5); \ - REAL_NEW__CREATE2(NEW_CLASS) \ - REAL_NEW__SETUP1(NEW_CLASS) \ - PD_TYPE, PD_TWO, PD_THREE, PD_FOUR, PD_FIVE \ - REAL_NEW__SETUP2(NEW_CLASS) - - -////////////////////////////////////////////////////////////////////////////// -// These should never be called or used directly!!! -// -// -/////////////////////////////////////////////////////////////////////////////// - -#define REAL_NEW__CLASS(NEW_CLASS) STATIC_CLASS t_class * NEW_CLASS ## _class -#define REAL_NEW__CREATE1(NEW_CLASS) { \ - try{ \ - Obj_header *obj = new (pd_new(NEW_CLASS ## _class),(void *)NULL) Obj_header; \ - CPPExtern::m_holder = &obj->pd_obj; \ - CPPExtern::m_holdname=(char*)#NEW_CLASS; - -#define REAL_NEW__CREATE2(NEW_CLASS) \ - CPPExtern::m_holder = NULL; \ - CPPExtern::m_holdname=NULL; \ - return(obj); \ - } catch (...) {gem::catchGemException(CPPExtern::m_holdname, CPPExtern::m_holder); return NULL;} \ - } - -#define REAL_NEW__SETUP1(NEW_CLASS) \ - extern "C" { \ - GEM_EXPORT void NEW_CLASS ## _setup(void) \ - { \ - static int recalled=0; if(recalled)return; recalled=1; \ - NEW_CLASS ## _class = class_new( \ - gensym(#NEW_CLASS), \ - (t_newmethod)create_ ## NEW_CLASS, \ - (t_method)&NEW_CLASS::obj_freeCallback, \ - sizeof(Obj_header), GEM_CLASSFLAGS, -#define REAL_NEW__SETUP2(NEW_CLASS) \ - A_NULL); \ - SET_HELPSYMBOL(NEW_CLASS); \ - NEW_CLASS::real_obj_setupCallback(NEW_CLASS ## _class); \ - } \ - } \ - AUTO_REGISTER_CLASS(NEW_CLASS); - - -/////////////////////////////////////////////////////////////////////////////// -// static class: -// by default classes are declared static -// however, sometimes we need classes not-static, so we can refer to them -// from other classes -/////////////////////////////////////////////////////////////////////////////// -#ifdef NO_STATIC_CLASS -# define STATIC_CLASS -#else -# define STATIC_CLASS static -#endif - -/////////////////////////////////////////////////////////////////////////////// -// auto registering a class -// this creates a dummy class, whose constructor calls the setup-function -// (registering the class with pd) -// a static copy of this class is created at runtime, to actually do the setup-call -/////////////////////////////////////////////////////////////////////////////// -#ifdef NO_AUTO_REGISTER_CLASS -// if NO_AUTO_REGISTER_CLASS is defined, we will not register the class -# define AUTO_REGISTER_CLASS(NEW_CLASS) \ - static int NEW_CLASS ## _dummyinstance -#else -// for debugging we can show the which classes are auto-registering -# if 0 -# define POST_AUTOREGISTER(NEW_CLASS) post("auto-registering: "#NEW_CLASS) -# else -# define POST_AUTOREGISTER(NEW_CLASS) -# endif -# define AUTO_REGISTER_CLASS(NEW_CLASS) \ - class NEW_CLASS ## _cppclass { \ - public: \ - NEW_CLASS ## _cppclass(void) {POST_AUTOREGISTER(NEW_CLASS); NEW_CLASS ## _setup(); } \ -}; \ - static NEW_CLASS ## _cppclass NEW_CLASS ## _instance -#endif - -/////////////////////////////////////////////////////////////////////////////// -// setting the help-symbol -/////////////////////////////////////////////////////////////////////////////// -#if defined HELPSYMBOL_BASE || defined HELPSYMBOL -# ifndef HELPSYMBOL_BASE -# define HELPSYMBOL_BASE "" -# endif - -# ifndef HELPSYMBOL -# define SET_HELPSYMBOL(NEW_CLASS) \ - class_sethelpsymbol(NEW_CLASS ## _class, gensym(HELPSYMBOL_BASE #NEW_CLASS)) -# else -# define SET_HELPSYMBOL(NEW_CLASS) \ - class_sethelpsymbol(NEW_CLASS ## _class, gensym(HELPSYMBOL_BASE HELPSYMBOL)) -# endif - -#else -# define SET_HELPSYMBOL(NEW_CLASS) -#endif /* HELPSYMBOL */ - -/////////////////////////////////////////////////////////////////////////////// -// setting the class-flags -/////////////////////////////////////////////////////////////////////////////// -#ifndef GEM_CLASSFLAGS -# define GEM_CLASSFLAGS 0 -#endif - -// macros for boilerplate code to object messages -#include "RTE/MessageCallbacks.h" - -#endif // for header file +/*----------------------------------------------------------------- +LOG + GEM - Graphics Environment for Multimedia + + The base class for all externs written in C++ + + Copyright (c) 1997-1999 Mark Danks. mark@danks.org + For information on usage and redistribution, and for a DISCLAIMER OF ALL + WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. + +-----------------------------------------------------------------*/ + +#ifndef _INCLUDE__GEM_BASE_CPPEXTERN_H_ +#define _INCLUDE__GEM_BASE_CPPEXTERN_H_ + +#include "Gem/ExportDef.h" + +#include "Gem/RTE.h" +#include "Gem/Version.h" + +#include +#include + +class CPPExtern; + +/* forward declaration of a generic exception handler for GemExceptions */ +namespace gem { + GEM_EXTERN void catchGemException(const char*objname, const t_object*obj); +}; + +/*----------------------------------------------------------------- +------------------------------------------------------------------- +CLASS + Obj_header + + The obligatory object header + +DESCRIPTION + + This is in a separate struct to assure that when PD uses the + class, the t_object is the very first thing. If it were the + first thing in CPPExtern, then there could be problems with + the vtable. + +-----------------------------------------------------------------*/ +struct GEM_EXTERN Obj_header +{ + ////////// + // The obligatory object header + t_object pd_obj; + + ////////// + // Our data structure + CPPExtern *data; + + // This has a dummy arg so that NT won't complain + void *operator new(size_t, void *location, void *dummy); +}; + +/*----------------------------------------------------------------- +------------------------------------------------------------------- +CLASS + CPPExtern + + The base class for all externs written in C++ + +DESCRIPTION + + Each extern which is written in C++ needs to use the #defines at the + end of this header file. Currently, the operator new(size_t) and + operator delete(void *) are not overridden. This will be a problem + when PD expects everything to fit in its memory space and control + all memory allocation. + + The define + + CPPEXTERN_HEADER(NEW_CLASS, PARENT_CLASS); + + should be somewhere in your header file. + One of the defines like + + CPPEXTERN_NEW(NEW_CLASS); + CPPEXTERN_NEW_WITH_TWO_ARGS(NEW_CLASS, t_floatarg, A_FLOAT, t_floatarg, A_FLOAT); + + should be the first thing in your implementation file. + NEW_CLASS is the name of your class and PARENT_CLASS is the + parent of your class. + +-----------------------------------------------------------------*/ +class GEM_EXTERN CPPExtern +{ + public: + + ////////// + // Constructor + CPPExtern(void); + + ////////// + // The Pd header + t_object *x_obj; + + ////////// + // Destructor + virtual ~CPPExtern(void) = 0; + + ////////// + // Get the object's canvas + const t_canvas *getCanvas(void) const { return(m_canvas); } + + ////////// + // This is a holder - don't touch it + static t_object *m_holder; + + ////////// + // my name + static char *m_holdname; + t_symbol *m_objectname; + + protected: + + ////////// + // Creation callback + static void real_obj_setupCallback(t_class *) {} + + private: + + ////////// + // The canvas that the object is in + t_canvas *m_canvas; + + public: + // these call pd's print-functions, and eventually prepend the object's name + void startpost(const char*format, ...) const; + void post(const char*format, ...) const; + void endpost(void) const; + void verbose(const int level, const char*format, ...) const; + void error(const char*format, ...) const; /* internally uses pd_error() */ + + // searches for a file based on the parent abstraction's path + // wraps open_via_path() and canvas_makefilename() + // the full filename is returned + // if the file does not exist, it is constructed + std::string findFile(const std::string filename, const std::string ext) const; + std::string findFile(const std::string filename) const; + + private: + mutable bool m_endpost; /* internal state for startpost/post/endpost */ + static bool checkGemVersion(const int major, const int minor); + CPPExtern(const CPPExtern&); + virtual CPPExtern&operator=(const CPPExtern&); +}; + +//////////////////////////////////////// +// This should be used in the header +//////////////////////////////////////// + +#define CPPEXTERN_HEADER(NEW_CLASS, PARENT_CLASS) \ +public: \ +static void obj_freeCallback(void *data) \ +{ CPPExtern *mydata = ((Obj_header *)data)->data; delete mydata; \ + ((Obj_header *)data)->Obj_header::~Obj_header(); } \ +static void real_obj_setupCallback(t_class *classPtr) \ +{ PARENT_CLASS::real_obj_setupCallback(classPtr); \ + NEW_CLASS::obj_setupCallback(classPtr); } \ +private: \ +static inline NEW_CLASS *GetMyClass(void *data) {return((NEW_CLASS *)((Obj_header *)data)->data);} \ +static void obj_setupCallback(t_class *classPtr); + + +//////////////////////////////////////// +// This should be the first thing in the implementation file +//////////////////////////////////////// + +// +// NO ARGUMENTS +///////////////////////////////////////////////// +#define CPPEXTERN_NEW(NEW_CLASS) \ + REAL_NEW__CLASS(NEW_CLASS); \ + static void* create_ ## NEW_CLASS (void) \ + REAL_NEW__CREATE1(NEW_CLASS) \ + obj->data = new NEW_CLASS(); \ + REAL_NEW__CREATE2(NEW_CLASS) \ + REAL_NEW__SETUP1(NEW_CLASS) \ + REAL_NEW__SETUP2(NEW_CLASS) + +// +// ONE ARGUMENT +///////////////////////////////////////////////// +#define CPPEXTERN_NEW_WITH_ONE_ARG(NEW_CLASS, TYPE, PD_TYPE) \ + REAL_NEW__CLASS(NEW_CLASS); \ + static void* create_ ## NEW_CLASS (TYPE arg) \ + REAL_NEW__CREATE1(NEW_CLASS) \ + obj->data = new NEW_CLASS(arg); \ + REAL_NEW__CREATE2(NEW_CLASS) \ + REAL_NEW__SETUP1(NEW_CLASS) \ + PD_TYPE, \ + REAL_NEW__SETUP2(NEW_CLASS) + +// +// GIMME ARGUMENT +///////////////////////////////////////////////// +#define CPPEXTERN_NEW_WITH_GIMME(NEW_CLASS) \ + REAL_NEW__CLASS(NEW_CLASS); \ + static void* create_ ## NEW_CLASS (t_symbol*s, int argc, t_atom*argv) \ + REAL_NEW__CREATE1(NEW_CLASS) \ + obj->data = new NEW_CLASS(argc,argv); \ + REAL_NEW__CREATE2(NEW_CLASS) \ + REAL_NEW__SETUP1(NEW_CLASS) \ + A_GIMME, \ + REAL_NEW__SETUP2(NEW_CLASS) + +// +// TWO ARGUMENTS +///////////////////////////////////////////////// +#define CPPEXTERN_NEW_WITH_TWO_ARGS(NEW_CLASS, TYPE, PD_TYPE, TTWO, PD_TWO) \ + REAL_NEW__CLASS(NEW_CLASS); \ + static void* create_ ## NEW_CLASS (TYPE arg, TTWO arg2) \ + REAL_NEW__CREATE1(NEW_CLASS) \ + obj->data = new NEW_CLASS(arg, arg2); \ + REAL_NEW__CREATE2(NEW_CLASS) \ + REAL_NEW__SETUP1(NEW_CLASS) \ + PD_TYPE, PD_TWO, \ + REAL_NEW__SETUP2(NEW_CLASS) + +// +// THREE ARGUMENTS +///////////////////////////////////////////////// +#define CPPEXTERN_NEW_WITH_THREE_ARGS(NEW_CLASS, TYPE, PD_TYPE, TTWO, PD_TWO, TTHREE, PD_THREE) \ + REAL_NEW__CLASS(NEW_CLASS); \ + static void* create_ ## NEW_CLASS (TYPE arg, TTWO arg2, TTHREE arg3) \ + REAL_NEW__CREATE1(NEW_CLASS) \ + obj->data = new NEW_CLASS(arg, arg2, arg3); \ + REAL_NEW__CREATE2(NEW_CLASS) \ + REAL_NEW__SETUP1(NEW_CLASS) \ + PD_TYPE, PD_TWO, PD_THREE, \ + REAL_NEW__SETUP2(NEW_CLASS) + +// +// FOUR ARGUMENTS +///////////////////////////////////////////////// +#define CPPEXTERN_NEW_WITH_FOUR_ARGS(NEW_CLASS, TYPE, PD_TYPE, TTWO, PD_TWO, TTHREE, PD_THREE, TFOUR, PD_FOUR) \ + REAL_NEW__CLASS(NEW_CLASS); \ + static void* create_ ## NEW_CLASS (TYPE arg, TTWO arg2, TTHREE arg3, TFOUR arg4) \ + REAL_NEW__CREATE1(NEW_CLASS) \ + obj->data = new NEW_CLASS(arg, arg2, arg3, arg4); \ + REAL_NEW__CREATE2(NEW_CLASS) \ + REAL_NEW__SETUP1(NEW_CLASS) \ + PD_TYPE, PD_TWO, PD_THREE, PD_FOUR, \ + REAL_NEW__SETUP2(NEW_CLASS) + +// +// FIVE ARGUMENTS +///////////////////////////////////////////////// +#define CPPEXTERN_NEW_WITH_FIVE_ARGS(NEW_CLASS, TYPE, PD_TYPE, TTWO, PD_TWO, TTHREE, PD_THREE, TFOUR, PD_FOUR, TFIVE, PD_FIVE) \ + REAL_NEW__CLASS(NEW_CLASS); \ + static void* create_ ## NEW_CLASS (TYPE arg, TTWO arg2, TTHREE arg3, TFOUR arg4, TFIVE arg5) \ + REAL_NEW__CREATE1(NEW_CLASS) \ + obj->data = new NEW_CLASS(arg, arg2, arg3, arg4, arg5); \ + REAL_NEW__CREATE2(NEW_CLASS) \ + REAL_NEW__SETUP1(NEW_CLASS) \ + PD_TYPE, PD_TWO, PD_THREE, PD_FOUR, PD_FIVE \ + REAL_NEW__SETUP2(NEW_CLASS) + + +////////////////////////////////////////////////////////////////////////////// +// These should never be called or used directly!!! +// +// +/////////////////////////////////////////////////////////////////////////////// + +#define REAL_NEW__CLASS(NEW_CLASS) STATIC_CLASS t_class * NEW_CLASS ## _class +#define REAL_NEW__CREATE1(NEW_CLASS) { \ + try{ \ + Obj_header *obj = new (pd_new(NEW_CLASS ## _class),(void *)NULL) Obj_header; \ + CPPExtern::m_holder = &obj->pd_obj; \ + CPPExtern::m_holdname=(char*)#NEW_CLASS; + +#define REAL_NEW__CREATE2(NEW_CLASS) \ + CPPExtern::m_holder = NULL; \ + CPPExtern::m_holdname=NULL; \ + return(obj); \ + } catch (...) {gem::catchGemException(CPPExtern::m_holdname, CPPExtern::m_holder); return NULL;} \ + } + +#define REAL_NEW__SETUP1(NEW_CLASS) \ + extern "C" { \ + GEM_EXPORT void NEW_CLASS ## _setup(void) \ + { \ + static int recalled=0; if(recalled)return; recalled=1; \ + NEW_CLASS ## _class = class_new( \ + gensym(#NEW_CLASS), \ + (t_newmethod)create_ ## NEW_CLASS, \ + (t_method)&NEW_CLASS::obj_freeCallback, \ + sizeof(Obj_header), GEM_CLASSFLAGS, +#define REAL_NEW__SETUP2(NEW_CLASS) \ + A_NULL); \ + SET_HELPSYMBOL(NEW_CLASS); \ + NEW_CLASS::real_obj_setupCallback(NEW_CLASS ## _class); \ + } \ + } \ + AUTO_REGISTER_CLASS(NEW_CLASS); + + +/////////////////////////////////////////////////////////////////////////////// +// static class: +// by default classes are declared static +// however, sometimes we need classes not-static, so we can refer to them +// from other classes +/////////////////////////////////////////////////////////////////////////////// +#ifdef NO_STATIC_CLASS +# define STATIC_CLASS +#else +# define STATIC_CLASS static +#endif + +/////////////////////////////////////////////////////////////////////////////// +// auto registering a class +// this creates a dummy class, whose constructor calls the setup-function +// (registering the class with pd) +// a static copy of this class is created at runtime, to actually do the setup-call +/////////////////////////////////////////////////////////////////////////////// +#ifdef NO_AUTO_REGISTER_CLASS +// if NO_AUTO_REGISTER_CLASS is defined, we will not register the class +# define AUTO_REGISTER_CLASS(NEW_CLASS) \ + static int NEW_CLASS ## _dummyinstance +#else +// for debugging we can show the which classes are auto-registering +# if 0 +# define POST_AUTOREGISTER(NEW_CLASS) post("auto-registering: "#NEW_CLASS) +# else +# define POST_AUTOREGISTER(NEW_CLASS) +# endif +# define AUTO_REGISTER_CLASS(NEW_CLASS) \ + class NEW_CLASS ## _cppclass { \ + public: \ + NEW_CLASS ## _cppclass(void) {POST_AUTOREGISTER(NEW_CLASS); NEW_CLASS ## _setup(); } \ +}; \ + static NEW_CLASS ## _cppclass NEW_CLASS ## _instance +#endif + +/////////////////////////////////////////////////////////////////////////////// +// setting the help-symbol +/////////////////////////////////////////////////////////////////////////////// +#if defined HELPSYMBOL_BASE || defined HELPSYMBOL +# ifndef HELPSYMBOL_BASE +# define HELPSYMBOL_BASE "" +# endif + +# ifndef HELPSYMBOL +# define SET_HELPSYMBOL(NEW_CLASS) \ + class_sethelpsymbol(NEW_CLASS ## _class, gensym(HELPSYMBOL_BASE #NEW_CLASS)) +# else +# define SET_HELPSYMBOL(NEW_CLASS) \ + class_sethelpsymbol(NEW_CLASS ## _class, gensym(HELPSYMBOL_BASE HELPSYMBOL)) +# endif + +#else +# define SET_HELPSYMBOL(NEW_CLASS) +#endif /* HELPSYMBOL */ + +/////////////////////////////////////////////////////////////////////////////// +// setting the class-flags +/////////////////////////////////////////////////////////////////////////////// +#ifndef GEM_CLASSFLAGS +# define GEM_CLASSFLAGS 0 +#endif + +// macros for boilerplate code to object messages +#include "RTE/MessageCallbacks.h" + +#endif // for header file diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemBase.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemBase.h index c1a6394e..e56b0075 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemBase.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemBase.h @@ -1,140 +1,140 @@ -/*----------------------------------------------------------------- - LOG - GEM - Graphics Environment for Multimedia - - The base class for all of the gem objects - - Copyright (c) 1997-1999 Mark Danks. mark@danks.org - Copyright (c) Günther Geiger. - Copyright (c) 2001-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at - For information on usage and redistribution, and for a DISCLAIMER OF ALL - WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. - - -----------------------------------------------------------------*/ - -#ifndef _INCLUDE__GEM_BASE_GEMBASE_H_ -#define _INCLUDE__GEM_BASE_GEMBASE_H_ - -#include "Gem/GemGL.h" -#include "Gem/ContextData.h" - -#include "Base/CPPExtern.h" - -class GemCache; -class GemState; -/*----------------------------------------------------------------- - ------------------------------------------------------------------- - CLASS - GemBase - - Base class for gem objects - - DESCRIPTION - - -----------------------------------------------------------------*/ -class GEM_EXTERN GemBase : public CPPExtern -{ - protected: - - ////////// - // Constructor - GemBase(); - - ////////// - // Destructor - virtual ~GemBase(); - - ////////// - virtual void render(GemState *state) = 0; - - ////////// - void continueRender(GemState *state); - - ////////// - // After objects below you in the chain have finished. - // You should reset all GEM/OpenGL states here. - virtual void postrender(GemState *) { ; } - - ////////// - // Called when rendering stops - -#if 1/*(jmz) this seems to be for gem2pdp*/ - virtual void stoprender() { realStopRendering(); } -#endif - - ////////// - // If you care about the start of rendering - virtual void startRendering() { ; } - - ////////// - // If you care about the stop of rendering - virtual void stopRendering() { ; } - - - ////////// - // has rendering started ? - // deprecated, use 'getState()==RENDERING' instead - bool gem_amRendering; - - ////////// - // If anything in the object has changed - virtual void setModified(); - - ////////// - // Don't mess with this unless you know what you are doing. - GemCache *m_cache; - ////////// - // check whether this object has changed - bool m_modified; - - ////////// - // The outlet - t_outlet *m_out1; - - - ////////// - // this gets called in the before the startRendering() routine - // if it returns TRUE, the object's startRendering(), render() and stopRendering() functions will be called - // it it returns FALSE, the object will be disabled - // when rendering is restarted, this function get's called again - // the default is to enable rendering - // this function is important if you want to disable an object because it cannot be used (e.g. missing driver support) - virtual bool isRunnable(void); - - ////////// - // creation callback - static void real_obj_setupCallback(t_class *classPtr) - { CPPExtern::real_obj_setupCallback(classPtr); GemBase::obj_setupCallback(classPtr); } - - - private: - - void realStopRendering(); - void gem_startstopMess(int state); - void gem_renderMess(GemCache* state, GemState* state2); - - static inline GemBase *GetMyClass(void *data) {return((GemBase *)((Obj_header *)data)->data);} - - friend class gemhead; - static void obj_setupCallback(t_class *classPtr); - static void gem_MessCallback(void *, t_symbol *,int, t_atom*); - static void renderCallback(GemBase *data, GemState *state); - static void postrenderCallback(GemBase *data, GemState *state); -#if 1 /*jmz this seems to be for gem2pdp*/ - static void stoprenderCallback(GemBase *data); //DH -#endif - - /* whether the object is internally disabled or not - * objects are to be disabled, if the system cannot make use of them, e.g. because of unsupported openGL features - */ - gem::ContextDatam_enabled; - - enum RenderState {INIT, ENABLED, DISABLED, RENDERING, MODIFIED}; - gem::ContextDatam_state; - - protected: - enum RenderState getState(void); - -}; - -#endif // for header file +/*----------------------------------------------------------------- + LOG + GEM - Graphics Environment for Multimedia + + The base class for all of the gem objects + + Copyright (c) 1997-1999 Mark Danks. mark@danks.org + Copyright (c) Günther Geiger. + Copyright (c) 2001-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at + For information on usage and redistribution, and for a DISCLAIMER OF ALL + WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. + + -----------------------------------------------------------------*/ + +#ifndef _INCLUDE__GEM_BASE_GEMBASE_H_ +#define _INCLUDE__GEM_BASE_GEMBASE_H_ + +#include "Gem/GemGL.h" +#include "Gem/ContextData.h" + +#include "Base/CPPExtern.h" + +class GemCache; +class GemState; +/*----------------------------------------------------------------- + ------------------------------------------------------------------- + CLASS + GemBase + + Base class for gem objects + + DESCRIPTION + + -----------------------------------------------------------------*/ +class GEM_EXTERN GemBase : public CPPExtern +{ + protected: + + ////////// + // Constructor + GemBase(); + + ////////// + // Destructor + virtual ~GemBase(); + + ////////// + virtual void render(GemState *state) = 0; + + ////////// + void continueRender(GemState *state); + + ////////// + // After objects below you in the chain have finished. + // You should reset all GEM/OpenGL states here. + virtual void postrender(GemState *) { ; } + + ////////// + // Called when rendering stops + +#if 1/*(jmz) this seems to be for gem2pdp*/ + virtual void stoprender() { realStopRendering(); } +#endif + + ////////// + // If you care about the start of rendering + virtual void startRendering() { ; } + + ////////// + // If you care about the stop of rendering + virtual void stopRendering() { ; } + + + ////////// + // has rendering started ? + // deprecated, use 'getState()==RENDERING' instead + bool gem_amRendering; + + ////////// + // If anything in the object has changed + virtual void setModified(); + + ////////// + // Don't mess with this unless you know what you are doing. + GemCache *m_cache; + ////////// + // check whether this object has changed + bool m_modified; + + ////////// + // The outlet + t_outlet *m_out1; + + + ////////// + // this gets called in the before the startRendering() routine + // if it returns TRUE, the object's startRendering(), render() and stopRendering() functions will be called + // it it returns FALSE, the object will be disabled + // when rendering is restarted, this function get's called again + // the default is to enable rendering + // this function is important if you want to disable an object because it cannot be used (e.g. missing driver support) + virtual bool isRunnable(void); + + ////////// + // creation callback + static void real_obj_setupCallback(t_class *classPtr) + { CPPExtern::real_obj_setupCallback(classPtr); GemBase::obj_setupCallback(classPtr); } + + + private: + + void realStopRendering(); + void gem_startstopMess(int state); + void gem_renderMess(GemCache* state, GemState* state2); + + static inline GemBase *GetMyClass(void *data) {return((GemBase *)((Obj_header *)data)->data);} + + friend class gemhead; + static void obj_setupCallback(t_class *classPtr); + static void gem_MessCallback(void *, t_symbol *,int, t_atom*); + static void renderCallback(GemBase *data, GemState *state); + static void postrenderCallback(GemBase *data, GemState *state); +#if 1 /*jmz this seems to be for gem2pdp*/ + static void stoprenderCallback(GemBase *data); //DH +#endif + + /* whether the object is internally disabled or not + * objects are to be disabled, if the system cannot make use of them, e.g. because of unsupported openGL features + */ + gem::ContextDatam_enabled; + + enum RenderState {INIT, ENABLED, DISABLED, RENDERING, MODIFIED}; + gem::ContextDatam_state; + + protected: + enum RenderState getState(void); + +}; + +#endif // for header file diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemCache.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemCache.h index cc52dabb..468b5456 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemCache.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemCache.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning GemCache.h is deprecated - please include "Gem/Cache.h" instead -#endif -#include "Gem/Cache.h" +#ifdef __GNUC__ +# warning GemCache.h is deprecated - please include "Gem/Cache.h" instead +#endif +#include "Gem/Cache.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemContext.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemContext.h index d755e89a..26eb1d1e 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemContext.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemContext.h @@ -1,57 +1,57 @@ -/*----------------------------------------------------------------- -LOG - GEM - Graphics Environment for Multimedia - - a rendering context - - Copyright (c) 2009-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at - For information on usage and redistribution, and for a DISCLAIMER OF ALL - WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. - ------------------------------------------------------------------*/ -#ifndef _INCLUDE__GEM_BASE_GEMCONTEXT_H_ -#define _INCLUDE__GEM_BASE_GEMCONTEXT_H_ - -#include "Gem/ExportDef.h" -#include "Gem/GemGL.h" - - -# if defined _WIN32 -typedef struct WGLEWContextStruct WGLEWContext; -# define GemGlewXContext WGLEWContext -# elif defined __linux__ || defined HAVE_GL_GLX_H -typedef struct GLXEWContextStruct GLXEWContext; -# define GemGlewXContext GLXEWContext -# else -# define GemGlewXContext void -# endif - -typedef struct GLEWContextStruct GLEWContext; - -namespace gem { -class GEM_EXTERN Context { - private: - class PIMPL; - PIMPL*m_pimpl; - - public: - Context(void); - Context(const Context&); - virtual ~Context(void); - - Context&operator=(const Context&); - - // make context current - bool push(void); - - // make context uncurrent - bool pop(void); - - public: - static unsigned int getContextId(void); - static GLEWContext*getGlewContext(void); - static GemGlewXContext*getGlewXContext(void); -}; - -}; // namespace -#endif // for header file +/*----------------------------------------------------------------- +LOG + GEM - Graphics Environment for Multimedia + + a rendering context + + Copyright (c) 2009-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at + For information on usage and redistribution, and for a DISCLAIMER OF ALL + WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. + +-----------------------------------------------------------------*/ +#ifndef _INCLUDE__GEM_BASE_GEMCONTEXT_H_ +#define _INCLUDE__GEM_BASE_GEMCONTEXT_H_ + +#include "Gem/ExportDef.h" +#include "Gem/GemGL.h" + + +# if defined _WIN32 +typedef struct WGLEWContextStruct WGLEWContext; +# define GemGlewXContext WGLEWContext +# elif defined __linux__ || defined HAVE_GL_GLX_H +typedef struct GLXEWContextStruct GLXEWContext; +# define GemGlewXContext GLXEWContext +# else +# define GemGlewXContext void +# endif + +typedef struct GLEWContextStruct GLEWContext; + +namespace gem { +class GEM_EXTERN Context { + private: + class PIMPL; + PIMPL*m_pimpl; + + public: + Context(void); + Context(const Context&); + virtual ~Context(void); + + Context&operator=(const Context&); + + // make context current + bool push(void); + + // make context uncurrent + bool pop(void); + + public: + static unsigned int getContextId(void); + static GLEWContext*getGlewContext(void); + static GemGlewXContext*getGlewXContext(void); +}; + +}; // namespace +#endif // for header file diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemContextData.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemContextData.h index 1f722c89..de5aae4a 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemContextData.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemContextData.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning Base/GemContextData.h is deprecated - please include "Gem/ContextData.h" instead -#endif -#include "Gem/ContextData.h" +#ifdef __GNUC__ +# warning Base/GemContextData.h is deprecated - please include "Gem/ContextData.h" instead +#endif +#include "Gem/ContextData.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemEvent.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemEvent.h index 5baedbc8..c0207bb1 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemEvent.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemEvent.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning GemEvent.h is deprecated - please include "Gem/Event.h" instead -#endif -#include "Gem/Event.h" +#ifdef __GNUC__ +# warning GemEvent.h is deprecated - please include "Gem/Event.h" instead +#endif +#include "Gem/Event.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemExportDef.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemExportDef.h index 1a12ef3a..e1e682c9 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemExportDef.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemExportDef.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning Base/GemExportDef.h is deprecated - please include "Gem/ExportDef.h" instead -#endif -#include "Gem/ExportDef.h" +#ifdef __GNUC__ +# warning Base/GemExportDef.h is deprecated - please include "Gem/ExportDef.h" instead +#endif +#include "Gem/ExportDef.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemFuncUtil.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemFuncUtil.h index d07c0aa5..42808e9f 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemFuncUtil.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemFuncUtil.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning GemFuncUtil.h is deprecated - please include "Utils/Functions.h" instead -#endif -#include "Utils/Functions.h" +#ifdef __GNUC__ +# warning GemFuncUtil.h is deprecated - please include "Utils/Functions.h" instead +#endif +#include "Utils/Functions.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemGL.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemGL.h index 2c43655d..d027fc38 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemGL.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemGL.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning GemGL.h is deprecated - please include "Gem/GemGL.h" instead -#endif -#include "Gem/GemGL.h" +#ifdef __GNUC__ +# warning GemGL.h is deprecated - please include "Gem/GemGL.h" instead +#endif +#include "Gem/GemGL.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemGLBase.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemGLBase.h index 6a3d319f..2f63b8bf 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemGLBase.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemGLBase.h @@ -1,23 +1,23 @@ -/* ------------------------------------------------------------------ - * GEM - Graphics Environment for Multimedia - * - * Copyright (c) 2008 zmoelnig@iem.at - * For information on usage and redistribution, and for a DISCLAIMER - * OF ALL WARRANTIES, see the file, "GEM.LICENSE.TERMS" - * - * this file has been generated... - * ------------------------------------------------------------------ - */ -#ifndef _INCLUDE__GEM_BASE_GEMGLBASE_H_ -#define _INCLUDE__GEM_BASE_GEMGLBASE_H_ - -#include "Utils/GLUtil.h" -#include "Base/GemBase.h" - -class GEM_EXTERN GemGLBase : public GemBase -{ - -}; - - -#endif /* for header file */ +/* ------------------------------------------------------------------ + * GEM - Graphics Environment for Multimedia + * + * Copyright (c) 2008 zmoelnig@iem.at + * For information on usage and redistribution, and for a DISCLAIMER + * OF ALL WARRANTIES, see the file, "GEM.LICENSE.TERMS" + * + * this file has been generated... + * ------------------------------------------------------------------ + */ +#ifndef _INCLUDE__GEM_BASE_GEMGLBASE_H_ +#define _INCLUDE__GEM_BASE_GEMGLBASE_H_ + +#include "Utils/GLUtil.h" +#include "Base/GemBase.h" + +class GEM_EXTERN GemGLBase : public GemBase +{ + +}; + + +#endif /* for header file */ diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemGLUtil.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemGLUtil.h index da69562c..0ddb0983 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemGLUtil.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemGLUtil.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning GemGLUtil.h is deprecated - please include "Utils/GLUtil.h" instead -#endif -#include "Utils/GLUtil.h" +#ifdef __GNUC__ +# warning GemGLUtil.h is deprecated - please include "Utils/GLUtil.h" instead +#endif +#include "Utils/GLUtil.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemGluObj.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemGluObj.h index 201cfa99..50d2831f 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemGluObj.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemGluObj.h @@ -1,96 +1,96 @@ -/*----------------------------------------------------------------- -LOG - GEM - Graphics Environment for Multimedia - - A Glu object - - Copyright (c) 1997-2000 Mark Danks. mark@danks.org - Copyright (c) Günther Geiger. geiger@epy.co.at - Copyright (c) 2001-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at - For information on usage and redistribution, and for a DISCLAIMER OF ALL - WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. - ------------------------------------------------------------------*/ - -#ifndef _INCLUDE__GEM_BASE_GEMGLUOBJ_H_ -#define _INCLUDE__GEM_BASE_GEMGLUOBJ_H_ - -// I hate Microsoft...I shouldn't have to do this! -#ifdef _WIN32 -#include -#endif - -#include - - -#include -#ifndef M_PI -# define M_PI (3.1415926) -#endif - -#include "Base/GemShape.h" - -#ifndef GLU_SILHOUETTE -# define GLU_SILHOUETTE 0 -#endif - -/*----------------------------------------------------------------- -------------------------------------------------------------------- -CLASS - GemGluObj - - A Glu object - -DESCRIPTION - - Inlet for an int - "in2" - - "in2" - the number of slices in the object - ------------------------------------------------------------------*/ -class GEM_EXTERN GemGluObj : public GemShape -{ - public: - - ////////// - // Constructor - GemGluObj(t_floatarg size, t_floatarg slices=10.f, t_floatarg stacks=0.f); - - protected: - - ////////// - // Destructor - virtual ~GemGluObj(); - - ////////// - // How the object should be drawn - virtual void typeMess(t_symbol *type); - - ////////// - // The number of slices in the quadric - void numSlicesMess(int numSlices); - void numSlicesMess(int numSlices, int numStacks); - - ////////// - // The number of slices - int m_numSlices, m_numStacks; - - ////////// - t_inlet *m_sliceInlet; - - ////////// - // creation callback - static void real_obj_setupCallback(t_class *classPtr) - { GemShape::real_obj_setupCallback(classPtr); GemGluObj::obj_setupCallback(classPtr); } - - private: - - static inline GemGluObj *GetMyClass(void *data) {return((GemGluObj *)((Obj_header *)data)->data);} - - ////////// - // Static member functions - static void obj_setupCallback(t_class *classPtr); - static void numSlicesMessCallback(void *data, t_symbol*, int, t_atom*); -}; - -#endif // for header file +/*----------------------------------------------------------------- +LOG + GEM - Graphics Environment for Multimedia + + A Glu object + + Copyright (c) 1997-2000 Mark Danks. mark@danks.org + Copyright (c) Günther Geiger. geiger@epy.co.at + Copyright (c) 2001-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at + For information on usage and redistribution, and for a DISCLAIMER OF ALL + WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. + +-----------------------------------------------------------------*/ + +#ifndef _INCLUDE__GEM_BASE_GEMGLUOBJ_H_ +#define _INCLUDE__GEM_BASE_GEMGLUOBJ_H_ + +// I hate Microsoft...I shouldn't have to do this! +#ifdef _WIN32 +#include +#endif + +#include + + +#include +#ifndef M_PI +# define M_PI (3.1415926) +#endif + +#include "Base/GemShape.h" + +#ifndef GLU_SILHOUETTE +# define GLU_SILHOUETTE 0 +#endif + +/*----------------------------------------------------------------- +------------------------------------------------------------------- +CLASS + GemGluObj + + A Glu object + +DESCRIPTION + + Inlet for an int - "in2" + + "in2" - the number of slices in the object + +-----------------------------------------------------------------*/ +class GEM_EXTERN GemGluObj : public GemShape +{ + public: + + ////////// + // Constructor + GemGluObj(t_floatarg size, t_floatarg slices=10.f, t_floatarg stacks=0.f); + + protected: + + ////////// + // Destructor + virtual ~GemGluObj(); + + ////////// + // How the object should be drawn + virtual void typeMess(t_symbol *type); + + ////////// + // The number of slices in the quadric + void numSlicesMess(int numSlices); + void numSlicesMess(int numSlices, int numStacks); + + ////////// + // The number of slices + int m_numSlices, m_numStacks; + + ////////// + t_inlet *m_sliceInlet; + + ////////// + // creation callback + static void real_obj_setupCallback(t_class *classPtr) + { GemShape::real_obj_setupCallback(classPtr); GemGluObj::obj_setupCallback(classPtr); } + + private: + + static inline GemGluObj *GetMyClass(void *data) {return((GemGluObj *)((Obj_header *)data)->data);} + + ////////// + // Static member functions + static void obj_setupCallback(t_class *classPtr); + static void numSlicesMessCallback(void *data, t_symbol*, int, t_atom*); +}; + +#endif // for header file diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemLoaders.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemLoaders.h index f0efbc8d..5abd7f11 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemLoaders.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemLoaders.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning Base/GemLoaders.h is deprecated - please include "Gem/Loaders.h" instead -#endif -#include "Gem/Loaders.h" +#ifdef __GNUC__ +# warning Base/GemLoaders.h is deprecated - please include "Gem/Loaders.h" instead +#endif +#include "Gem/Loaders.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemMan.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemMan.h index ed4b9afc..43980184 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemMan.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemMan.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning GemMan.h is deprecated - please include "Gem/Manager.h" instead -#endif -#include "Gem/Manager.h" +#ifdef __GNUC__ +# warning GemMan.h is deprecated - please include "Gem/Manager.h" instead +#endif +#include "Gem/Manager.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemMath.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemMath.h index 4a26d02c..fcced2c6 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemMath.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemMath.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning GemMath.h is deprecated - please include "Utils/Math.h" instead -#endif -#include "Utils/Math.h" +#ifdef __GNUC__ +# warning GemMath.h is deprecated - please include "Utils/Math.h" instead +#endif +#include "Utils/Math.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemPBuffer.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemPBuffer.h index 46b12297..5c78f313 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemPBuffer.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemPBuffer.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning GemPBuffer.h is deprecated - please include "Gem/PBuffer.h" instead -#endif -#include "Gem/PBuffer.h" +#ifdef __GNUC__ +# warning GemPBuffer.h is deprecated - please include "Gem/PBuffer.h" instead +#endif +#include "Gem/PBuffer.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemPathBase.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemPathBase.h index 51418437..89784495 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemPathBase.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemPathBase.h @@ -1,74 +1,74 @@ -/*----------------------------------------------------------------- -LOG - GEM - Graphics Environment for Multimedia - - Base class for paths - - Copyright (c) 1997-1999 Mark Danks. mark@danks.org - Copyright (c) Günther Geiger. geiger@epy.co.at - Copyright (c) 2001-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at - For information on usage and redistribution, and for a DISCLAIMER OF ALL - WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. - ------------------------------------------------------------------*/ - -#ifndef _INCLUDE__GEM_BASE_GEMPATHBASE_H_ -#define _INCLUDE__GEM_BASE_GEMPATHBASE_H_ - -#include "Base/CPPExtern.h" - -/*----------------------------------------------------------------- -------------------------------------------------------------------- -CLASS - GemPathBase - - -DESCRIPTION - - ------------------------------------------------------------------*/ -class GEM_EXTERN GemPathBase : public CPPExtern -{ - CPPEXTERN_HEADER(GemPathBase, CPPExtern); - - public: - - ////////// - // Constructor - GemPathBase(int argc, t_atom *argv); - - protected: - - ////////// - // Destructor - virtual ~GemPathBase(); - - ////////// - // When an open is received - virtual void openMess(t_symbol *arrayname); - - ////////// - // When a float val is received - virtual void floatMess(float val) = 0; - - ////////// - // The number of dimensions - int m_numDimens; - - ////////// - // The array - t_garray *m_array; - - ////////// - // The outlet - t_outlet *m_out1; - - private: - - ////////// - // static member functions - static void openMessCallback(void *data, t_symbol *arrayname); - static void floatMessCallback(void *data, float n); -}; - -#endif // for header file +/*----------------------------------------------------------------- +LOG + GEM - Graphics Environment for Multimedia + + Base class for paths + + Copyright (c) 1997-1999 Mark Danks. mark@danks.org + Copyright (c) Günther Geiger. geiger@epy.co.at + Copyright (c) 2001-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at + For information on usage and redistribution, and for a DISCLAIMER OF ALL + WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. + +-----------------------------------------------------------------*/ + +#ifndef _INCLUDE__GEM_BASE_GEMPATHBASE_H_ +#define _INCLUDE__GEM_BASE_GEMPATHBASE_H_ + +#include "Base/CPPExtern.h" + +/*----------------------------------------------------------------- +------------------------------------------------------------------- +CLASS + GemPathBase + + +DESCRIPTION + + +-----------------------------------------------------------------*/ +class GEM_EXTERN GemPathBase : public CPPExtern +{ + CPPEXTERN_HEADER(GemPathBase, CPPExtern); + + public: + + ////////// + // Constructor + GemPathBase(int argc, t_atom *argv); + + protected: + + ////////// + // Destructor + virtual ~GemPathBase(); + + ////////// + // When an open is received + virtual void openMess(t_symbol *arrayname); + + ////////// + // When a float val is received + virtual void floatMess(float val) = 0; + + ////////// + // The number of dimensions + int m_numDimens; + + ////////// + // The array + t_garray *m_array; + + ////////// + // The outlet + t_outlet *m_out1; + + private: + + ////////// + // static member functions + static void openMessCallback(void *data, t_symbol *arrayname); + static void floatMessCallback(void *data, float n); +}; + +#endif // for header file diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemPixConvert.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemPixConvert.h index 5a2ef0de..a996e9a9 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemPixConvert.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemPixConvert.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning GemPixConvert.h is deprecated - please include "Gem/PixConvert.h" instead -#endif -#include "Gem/PixConvert.h" +#ifdef __GNUC__ +# warning GemPixConvert.h is deprecated - please include "Gem/PixConvert.h" instead +#endif +#include "Gem/PixConvert.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemPixDualObj.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemPixDualObj.h index 8e7d2cdf..9590f4d0 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemPixDualObj.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemPixDualObj.h @@ -1,190 +1,190 @@ -/*----------------------------------------------------------------- -LOG - GEM - Graphics Environment for Multimedia - - An object which accepts two pixes. - - Copyright (c) 1997-1999 Mark Danks. mark@danks.org - Copyright (c) Günther Geiger. geiger@epy.co.at - Copyright (c) 2001-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at - Copyright (c) 2002 James Tittle & Chris Clepper - For information on usage and redistribution, and for a DISCLAIMER OF ALL - WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. - ------------------------------------------------------------------*/ - -#ifndef _INCLUDE__GEM_BASE_GEMPIXDUALOBJ_H_ -#define _INCLUDE__GEM_BASE_GEMPIXDUALOBJ_H_ - -#define NEW_DUAL_PIX - -#include "Base/GemPixObj.h" - -/*----------------------------------------------------------------- -------------------------------------------------------------------- -CLASS - GemPixDualObj - - An object which accepts two pixes. - -DESCRIPTION - - Inlet for a gem - "gem_right" - - "gem_right" - The second gem list - ------------------------------------------------------------------*/ -class GEM_EXTERN GemPixDualObj : public GemPixObj -{ - public: - - ////////// - // Constructor - GemPixDualObj(); - - protected: - - ////////// - // Destructor - virtual ~GemPixDualObj(); - - void render(GemState *state); - - ////////// - // Derived classes should NOT override this! - // This makes sure that the images are the same size. - // This calls the other process functions based on the input images. - virtual void processImage(imageStruct &image); - -#ifndef NEW_DUAL_PIX - ////////// - // The derived class HAS override this. - // This is called whenever a new image comes through and - // both of the image structs are RGBA - virtual void processDualImage(imageStruct &image, imageStruct &right) = 0; - - ////////// - // The derived class CAN override this. - // This is called whenever a new image comes through and both - // of the image structs are gray8. - // The default behavior is to output an error. - virtual void processDualGray(imageStruct &image, imageStruct &right); - - ////////// - // The derived class CAN override this. - // This is called whenever a new image comes through and - // the left image is an RGBA while the right is a gray8. - // The default behavior is to output an error. - virtual void processRightGray(imageStruct &image, imageStruct &right); - - ////////// - // The derived class CAN override this. - // This is called whenever a new image comes through and - // the left image is a gray8, the right is an RGBA - // The default behavior is to output an error. - virtual void processLeftGray(imageStruct &image, imageStruct &right); - - ////////// - // The derived class CAN override this. - // This is called whenever a new image comes through and both - // of the image structs are YUV. - // The default behavior is to output an error. - virtual void processDualYUV(imageStruct &image, imageStruct &right); - - ////////// - // The derived class CAN override this. - // This is called whenever a new image comes through and - // the left image is an RGBA while the right is a YUV. - // The default behavior is to output an error. - virtual void processRightYUV(imageStruct &image, imageStruct &right); - - ////////// - // The derived class CAN override this. - // This is called whenever a new image comes through and - // the left image is a YUV, the right is an RGBA - // The default behavior is to output an error. - virtual void processLeftYUV(imageStruct &image, imageStruct &right); -#else - ////////// - // The derived class SHOULD override this, if it provides a method for "all" formats - virtual void processDualImage(imageStruct &left, imageStruct &right); - // Here come the more specific dual-processors - // The derived class SHOULD override these as needed - - /* for simplicity this is done via preprocessor defines: - * the functions defined are like : - ** processRGBA_RGBA(left, right); - */ - -#define PROCESS_DUALIMAGE(CS1, CS2) \ - virtual void process##CS1 ##_##CS2 (imageStruct &left, imageStruct &right){processDualImage(left, right);} - PROCESS_DUALIMAGE(RGBA, RGBA); - PROCESS_DUALIMAGE(RGBA, Gray); - PROCESS_DUALIMAGE(RGBA, YUV ); - - PROCESS_DUALIMAGE(Gray, RGBA); - PROCESS_DUALIMAGE(Gray, Gray); - PROCESS_DUALIMAGE(Gray, YUV ); - - PROCESS_DUALIMAGE(YUV, RGBA); - PROCESS_DUALIMAGE(YUV, Gray); - PROCESS_DUALIMAGE(YUV, YUV ); -#undef PROCESS_DUALIMAGE - - /* for simplicity this is done via preprocessor defines: - * the functions defined are like : - ** processRGBA_Altivec(left, right); - */ -#define PROCESS_DUALIMAGE_SIMD(CS1, CS2,_SIMD_EXT) \ - virtual void process##CS1 ##_##_SIMD_EXT (imageStruct &left, imageStruct &right){ \ - process##CS1 ##_##CS2 (left, right);} - - PROCESS_DUALIMAGE_SIMD(RGBA, RGBA, MMX); - PROCESS_DUALIMAGE_SIMD(RGBA, MMX , SSE2); - PROCESS_DUALIMAGE_SIMD(RGBA, RGBA, Altivec); - - PROCESS_DUALIMAGE_SIMD(YUV , YUV , MMX); - PROCESS_DUALIMAGE_SIMD(YUV , MMX , SSE2); - PROCESS_DUALIMAGE_SIMD(YUV , YUV , Altivec); - - PROCESS_DUALIMAGE_SIMD(Gray, Gray, MMX); - PROCESS_DUALIMAGE_SIMD(Gray, MMX , SSE2); - PROCESS_DUALIMAGE_SIMD(Gray, Gray, Altivec); -#undef PROCESS_DUALIMAGE_SIMD - -#endif - ////////// - virtual void postrender(GemState *); - virtual void stopRendering(); - virtual void rightstopRendering() { ; } - virtual void rightRender(GemState *state); - virtual void rightPostrender(GemState *) { ; } - virtual void rightStoprender() { ; } - - ////////// - GemCache *m_cacheRight; - - ////////// - pixBlock *m_pixRight; - - int m_pixRightValid; - int org_pixRightValid; - - ////////// - t_inlet *m_inlet; - - ////////// - // creation callback - static void real_obj_setupCallback(t_class *classPtr) - { GemPixObj::real_obj_setupCallback(classPtr); GemPixDualObj::obj_setupCallback(classPtr); } - - private: - - static inline GemPixDualObj *GetMyClass(void *data) {return((GemPixDualObj *)((Obj_header *)data)->data);} - - ////////// - // Static member functions - static void obj_setupCallback(t_class *classPtr); - static void gem_rightMessCallback(void *x, t_symbol *s, int argc, t_atom *argv); -}; -#endif // for header file +/*----------------------------------------------------------------- +LOG + GEM - Graphics Environment for Multimedia + + An object which accepts two pixes. + + Copyright (c) 1997-1999 Mark Danks. mark@danks.org + Copyright (c) Günther Geiger. geiger@epy.co.at + Copyright (c) 2001-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at + Copyright (c) 2002 James Tittle & Chris Clepper + For information on usage and redistribution, and for a DISCLAIMER OF ALL + WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. + +-----------------------------------------------------------------*/ + +#ifndef _INCLUDE__GEM_BASE_GEMPIXDUALOBJ_H_ +#define _INCLUDE__GEM_BASE_GEMPIXDUALOBJ_H_ + +#define NEW_DUAL_PIX + +#include "Base/GemPixObj.h" + +/*----------------------------------------------------------------- +------------------------------------------------------------------- +CLASS + GemPixDualObj + + An object which accepts two pixes. + +DESCRIPTION + + Inlet for a gem - "gem_right" + + "gem_right" - The second gem list + +-----------------------------------------------------------------*/ +class GEM_EXTERN GemPixDualObj : public GemPixObj +{ + public: + + ////////// + // Constructor + GemPixDualObj(); + + protected: + + ////////// + // Destructor + virtual ~GemPixDualObj(); + + void render(GemState *state); + + ////////// + // Derived classes should NOT override this! + // This makes sure that the images are the same size. + // This calls the other process functions based on the input images. + virtual void processImage(imageStruct &image); + +#ifndef NEW_DUAL_PIX + ////////// + // The derived class HAS override this. + // This is called whenever a new image comes through and + // both of the image structs are RGBA + virtual void processDualImage(imageStruct &image, imageStruct &right) = 0; + + ////////// + // The derived class CAN override this. + // This is called whenever a new image comes through and both + // of the image structs are gray8. + // The default behavior is to output an error. + virtual void processDualGray(imageStruct &image, imageStruct &right); + + ////////// + // The derived class CAN override this. + // This is called whenever a new image comes through and + // the left image is an RGBA while the right is a gray8. + // The default behavior is to output an error. + virtual void processRightGray(imageStruct &image, imageStruct &right); + + ////////// + // The derived class CAN override this. + // This is called whenever a new image comes through and + // the left image is a gray8, the right is an RGBA + // The default behavior is to output an error. + virtual void processLeftGray(imageStruct &image, imageStruct &right); + + ////////// + // The derived class CAN override this. + // This is called whenever a new image comes through and both + // of the image structs are YUV. + // The default behavior is to output an error. + virtual void processDualYUV(imageStruct &image, imageStruct &right); + + ////////// + // The derived class CAN override this. + // This is called whenever a new image comes through and + // the left image is an RGBA while the right is a YUV. + // The default behavior is to output an error. + virtual void processRightYUV(imageStruct &image, imageStruct &right); + + ////////// + // The derived class CAN override this. + // This is called whenever a new image comes through and + // the left image is a YUV, the right is an RGBA + // The default behavior is to output an error. + virtual void processLeftYUV(imageStruct &image, imageStruct &right); +#else + ////////// + // The derived class SHOULD override this, if it provides a method for "all" formats + virtual void processDualImage(imageStruct &left, imageStruct &right); + // Here come the more specific dual-processors + // The derived class SHOULD override these as needed + + /* for simplicity this is done via preprocessor defines: + * the functions defined are like : + ** processRGBA_RGBA(left, right); + */ + +#define PROCESS_DUALIMAGE(CS1, CS2) \ + virtual void process##CS1 ##_##CS2 (imageStruct &left, imageStruct &right){processDualImage(left, right);} + PROCESS_DUALIMAGE(RGBA, RGBA); + PROCESS_DUALIMAGE(RGBA, Gray); + PROCESS_DUALIMAGE(RGBA, YUV ); + + PROCESS_DUALIMAGE(Gray, RGBA); + PROCESS_DUALIMAGE(Gray, Gray); + PROCESS_DUALIMAGE(Gray, YUV ); + + PROCESS_DUALIMAGE(YUV, RGBA); + PROCESS_DUALIMAGE(YUV, Gray); + PROCESS_DUALIMAGE(YUV, YUV ); +#undef PROCESS_DUALIMAGE + + /* for simplicity this is done via preprocessor defines: + * the functions defined are like : + ** processRGBA_Altivec(left, right); + */ +#define PROCESS_DUALIMAGE_SIMD(CS1, CS2,_SIMD_EXT) \ + virtual void process##CS1 ##_##_SIMD_EXT (imageStruct &left, imageStruct &right){ \ + process##CS1 ##_##CS2 (left, right);} + + PROCESS_DUALIMAGE_SIMD(RGBA, RGBA, MMX); + PROCESS_DUALIMAGE_SIMD(RGBA, MMX , SSE2); + PROCESS_DUALIMAGE_SIMD(RGBA, RGBA, Altivec); + + PROCESS_DUALIMAGE_SIMD(YUV , YUV , MMX); + PROCESS_DUALIMAGE_SIMD(YUV , MMX , SSE2); + PROCESS_DUALIMAGE_SIMD(YUV , YUV , Altivec); + + PROCESS_DUALIMAGE_SIMD(Gray, Gray, MMX); + PROCESS_DUALIMAGE_SIMD(Gray, MMX , SSE2); + PROCESS_DUALIMAGE_SIMD(Gray, Gray, Altivec); +#undef PROCESS_DUALIMAGE_SIMD + +#endif + ////////// + virtual void postrender(GemState *); + virtual void stopRendering(); + virtual void rightstopRendering() { ; } + virtual void rightRender(GemState *state); + virtual void rightPostrender(GemState *) { ; } + virtual void rightStoprender() { ; } + + ////////// + GemCache *m_cacheRight; + + ////////// + pixBlock *m_pixRight; + + int m_pixRightValid; + int org_pixRightValid; + + ////////// + t_inlet *m_inlet; + + ////////// + // creation callback + static void real_obj_setupCallback(t_class *classPtr) + { GemPixObj::real_obj_setupCallback(classPtr); GemPixDualObj::obj_setupCallback(classPtr); } + + private: + + static inline GemPixDualObj *GetMyClass(void *data) {return((GemPixDualObj *)((Obj_header *)data)->data);} + + ////////// + // Static member functions + static void obj_setupCallback(t_class *classPtr); + static void gem_rightMessCallback(void *x, t_symbol *s, int argc, t_atom *argv); +}; +#endif // for header file diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemPixImageLoad.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemPixImageLoad.h index f7aefce1..4795bd8a 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemPixImageLoad.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemPixImageLoad.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning GemPixImageLoad.h is deprecated - please include "Gem/ImageIO.h" instead -#endif -#include "Gem/ImageIO.h" +#ifdef __GNUC__ +# warning GemPixImageLoad.h is deprecated - please include "Gem/ImageIO.h" instead +#endif +#include "Gem/ImageIO.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemPixImageSave.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemPixImageSave.h index f5f3bf73..5b0938de 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemPixImageSave.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemPixImageSave.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning GemPixImageSave.h is deprecated - please include "Gem/ImageIO.h" instead -#endif -#include "Gem/ImageIO.h" +#ifdef __GNUC__ +# warning GemPixImageSave.h is deprecated - please include "Gem/ImageIO.h" instead +#endif +#include "Gem/ImageIO.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemPixObj.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemPixObj.h index a7176893..699b5a40 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemPixObj.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemPixObj.h @@ -1,142 +1,142 @@ -/*----------------------------------------------------------------- -LOG - GEM - Graphics Environment for Multimedia - - Base class for pix class gem objects - - Copyright (c) 1997-1999 Mark Danks. mark@danks.org - Copyright (c) Günther Geiger. geiger@epy.co.at - Copyright (c) 2001-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at - For information on usage and redistribution, and for a DISCLAIMER OF ALL - WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. - ------------------------------------------------------------------*/ - -#ifndef _INCLUDE__GEM_BASE_GEMPIXOBJ_H_ -#define _INCLUDE__GEM_BASE_GEMPIXOBJ_H_ - -#include "Base/GemBase.h" -#include "Gem/Image.h" -#include "stdlib.h" -#include "string.h" -#include "math.h" - -/*----------------------------------------------------------------- -------------------------------------------------------------------- -CLASS - GemPixObj - - Base class for pix class gem objects - -DESCRIPTION - ------------------------------------------------------------------*/ -class GEM_EXTERN GemPixObj : public GemBase -{ - public: - - ////////// - // Constructor - GemPixObj(); - - protected: - - ////////// - // Destructor - virtual ~GemPixObj() { } - - ////////// - // The derived class should override this if it provides - // processing independent of the image.format - // This is called whenever a new image comes through. - // The default is to output an error - virtual void processImage(imageStruct &image); - - ////////// - // The derived class should override this. - // This is called whenever a new RGB image comes through. - // The default is to call processImage(). - virtual void processRGBImage(imageStruct &image); - - ////////// - // The derived class should override this. - // This is called whenever a new RGBA image comes through. - // The default is to call processImage(). - virtual void processRGBAImage(imageStruct &image); - // SIMD-optimized functions: by default the non-optimized function is called - virtual void processRGBAMMX(imageStruct &image); - virtual void processRGBASSE2(imageStruct &image); - virtual void processRGBAAltivec(imageStruct &image); - - ////////// - // The derived class should override this. - // This is called whenever a new gray8 image comes through. - // The default is to call processImage(). - virtual void processGrayImage(imageStruct &image); - // SIMD-optimized functions: by default the non-optimized function is called - virtual void processGrayMMX(imageStruct &image); - virtual void processGraySSE2(imageStruct &image); - virtual void processGrayAltivec(imageStruct &image); - - ////////// - // The derived class should override this. - // This is called whenever a new YUV422 image comes through. - // The default is to call processImage(). - virtual void processYUVImage(imageStruct &image); - // SIMD-optimized functions: by default the non-optimized function is called - virtual void processYUVMMX(imageStruct &image); - virtual void processYUVSSE2(imageStruct &image); - virtual void processYUVAltivec(imageStruct &image); - - ////////// - // If the derived class needs the image resent. - // This sets the dirty bit on the pixBlock. - void setPixModified(); - - ////////// - // Turn on/off processing - void processOnOff(int on); - - ////////// - // the pixBlock-cache - pixBlock cachedPixBlock; - pixBlock *orgPixBlock; - - ////////// - int m_processOnOff; - int m_simd; - - ////////// - // creation callback - static void real_obj_setupCallback(t_class *classPtr) { - GemBase::real_obj_setupCallback(classPtr); - GemPixObj::obj_setupCallback(classPtr); - } - - ////////// - // The derived class should NOT override this unless they have some - // very special behavior. - // Do the rendering, which calls processImage or processGrayImage, etc... - // save the image-information - virtual void render(GemState *state); - // turn the pointer back to the old data after rendering - virtual void postrender(GemState *state); - - void startRendering(void) { - //post("start rendering"); - setPixModified(); - } - - private: - - static inline GemPixObj *GetMyClass(void *data) {return((GemPixObj *)((Obj_header *)data)->data);} - - ////////// - // static member functions - static void obj_setupCallback(t_class *classPtr); - static void floatMessCallback(void *data, float n); - static void simdMessCallback(void *data, float n); -}; - - -#endif // for header file +/*----------------------------------------------------------------- +LOG + GEM - Graphics Environment for Multimedia + + Base class for pix class gem objects + + Copyright (c) 1997-1999 Mark Danks. mark@danks.org + Copyright (c) Günther Geiger. geiger@epy.co.at + Copyright (c) 2001-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at + For information on usage and redistribution, and for a DISCLAIMER OF ALL + WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. + +-----------------------------------------------------------------*/ + +#ifndef _INCLUDE__GEM_BASE_GEMPIXOBJ_H_ +#define _INCLUDE__GEM_BASE_GEMPIXOBJ_H_ + +#include "Base/GemBase.h" +#include "Gem/Image.h" +#include "stdlib.h" +#include "string.h" +#include "math.h" + +/*----------------------------------------------------------------- +------------------------------------------------------------------- +CLASS + GemPixObj + + Base class for pix class gem objects + +DESCRIPTION + +-----------------------------------------------------------------*/ +class GEM_EXTERN GemPixObj : public GemBase +{ + public: + + ////////// + // Constructor + GemPixObj(); + + protected: + + ////////// + // Destructor + virtual ~GemPixObj() { } + + ////////// + // The derived class should override this if it provides + // processing independent of the image.format + // This is called whenever a new image comes through. + // The default is to output an error + virtual void processImage(imageStruct &image); + + ////////// + // The derived class should override this. + // This is called whenever a new RGB image comes through. + // The default is to call processImage(). + virtual void processRGBImage(imageStruct &image); + + ////////// + // The derived class should override this. + // This is called whenever a new RGBA image comes through. + // The default is to call processImage(). + virtual void processRGBAImage(imageStruct &image); + // SIMD-optimized functions: by default the non-optimized function is called + virtual void processRGBAMMX(imageStruct &image); + virtual void processRGBASSE2(imageStruct &image); + virtual void processRGBAAltivec(imageStruct &image); + + ////////// + // The derived class should override this. + // This is called whenever a new gray8 image comes through. + // The default is to call processImage(). + virtual void processGrayImage(imageStruct &image); + // SIMD-optimized functions: by default the non-optimized function is called + virtual void processGrayMMX(imageStruct &image); + virtual void processGraySSE2(imageStruct &image); + virtual void processGrayAltivec(imageStruct &image); + + ////////// + // The derived class should override this. + // This is called whenever a new YUV422 image comes through. + // The default is to call processImage(). + virtual void processYUVImage(imageStruct &image); + // SIMD-optimized functions: by default the non-optimized function is called + virtual void processYUVMMX(imageStruct &image); + virtual void processYUVSSE2(imageStruct &image); + virtual void processYUVAltivec(imageStruct &image); + + ////////// + // If the derived class needs the image resent. + // This sets the dirty bit on the pixBlock. + void setPixModified(); + + ////////// + // Turn on/off processing + void processOnOff(int on); + + ////////// + // the pixBlock-cache + pixBlock cachedPixBlock; + pixBlock *orgPixBlock; + + ////////// + int m_processOnOff; + int m_simd; + + ////////// + // creation callback + static void real_obj_setupCallback(t_class *classPtr) { + GemBase::real_obj_setupCallback(classPtr); + GemPixObj::obj_setupCallback(classPtr); + } + + ////////// + // The derived class should NOT override this unless they have some + // very special behavior. + // Do the rendering, which calls processImage or processGrayImage, etc... + // save the image-information + virtual void render(GemState *state); + // turn the pointer back to the old data after rendering + virtual void postrender(GemState *state); + + void startRendering(void) { + //post("start rendering"); + setPixModified(); + } + + private: + + static inline GemPixObj *GetMyClass(void *data) {return((GemPixObj *)((Obj_header *)data)->data);} + + ////////// + // static member functions + static void obj_setupCallback(t_class *classPtr); + static void floatMessCallback(void *data, float n); + static void simdMessCallback(void *data, float n); +}; + + +#endif // for header file diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemPixPete.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemPixPete.h index 053ad9cf..c83547a7 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemPixPete.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemPixPete.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning GemPixPete.h is deprecated - please include "Utils/PixPete.h" instead -#endif -#include "Utils/PixPete.h" +#ifdef __GNUC__ +# warning GemPixPete.h is deprecated - please include "Utils/PixPete.h" instead +#endif +#include "Utils/PixPete.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemPixUtil.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemPixUtil.h index 628a1651..b4c6aff7 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemPixUtil.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemPixUtil.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning GemPixUtil.h is deprecated - please include "Gem/Image.h" instead -#endif -#include "Gem/Image.h" +#ifdef __GNUC__ +# warning GemPixUtil.h is deprecated - please include "Gem/Image.h" instead +#endif +#include "Gem/Image.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemSIMD.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemSIMD.h index eed6c17f..96af5bba 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemSIMD.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemSIMD.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning GemSIMD.h is deprecated - please include "Utils/SIMD.h" instead -#endif -#include "Utils/SIMD.h" +#ifdef __GNUC__ +# warning GemSIMD.h is deprecated - please include "Utils/SIMD.h" instead +#endif +#include "Utils/SIMD.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemShape.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemShape.h index d7c4a621..bb10ab80 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemShape.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemShape.h @@ -1,144 +1,144 @@ -/*----------------------------------------------------------------- -LOG - GEM - Graphics Environment for Multimedia - - Base class for shapes - - Copyright (c) 1997-1999 Mark Danks. mark@danks.org - Copyright (c) Günther Geiger. geiger@epy.co.at - Copyright (c) 2001-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at - For information on usage and redistribution, and for a DISCLAIMER OF ALL - WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. - ------------------------------------------------------------------*/ - -#ifndef _INCLUDE__GEM_BASE_GEMSHAPE_H_ -#define _INCLUDE__GEM_BASE_GEMSHAPE_H_ - -#include "Base/GemBase.h" - -/*----------------------------------------------------------------- -------------------------------------------------------------------- -CLASS - GemShape - - Base class for shapes - -DESCRIPTION - - Inlet for a float - "ft1" - - "ft1" - the size of the shape - "draw" - the drawing style - "width" - the line width when drawing with lines - ------------------------------------------------------------------*/ -class TexCoord; -class GEM_EXTERN GemShape : public GemBase -{ - public: - - ////////// - // Constructor - // [in] size - A size of 0. means to just use the default (ie, 1.) - GemShape(t_floatarg size); - GemShape(); - - protected: - - ////////// - // Destructor - virtual ~GemShape(); - - //----------------------------------- - // GROUP: Access functions - //----------------------------------- - - ////////// - // The width of the lines in line draw mode - void linewidthMess(float linewidth); - - ////////// - // The size of the object - void sizeMess(float size); - - ////////// - // How the object should be drawn - virtual void typeMess(t_symbol *type); - - //----------------------------------- - // GROUP: Utility functions - //----------------------------------- - - void SetVertex(GemState* state,float x, float y, float z, - float tx, float ty, - int curCoord); - - void SetVertex(GemState* state,float x, float y, float z, - float s, float t, float r, float q, - int curCoord); - - //----------------------------------- - // GROUP: Member variables - //----------------------------------- - - ////////// - // The line width for GL_LINE mode - GLfloat m_linewidth; - - ////////// - // The size of the object - GLfloat m_size; - - ////////// - // The drawing style (GL_LINE, GL_POLYGON, etc) - GLenum m_drawType; - - ////////// - // do we want blending? - GLboolean m_blend; - void blendMess(float blend); - - - //////// - // override this memberfunction to automatically enable softblended rendering,... - virtual void renderShape(GemState *state) {;} - - // OR - // override this memberfunction if you don't want softblending - virtual void render(GemState *state); - - - ////////// - // The size inlet - t_inlet *m_inlet; - - //----------------------------------- - // GROUP: Setup functions - //----------------------------------- - - ////////// - // creation callback - static void real_obj_setupCallback(t_class *classPtr) - { GemBase::real_obj_setupCallback(classPtr); GemShape::obj_setupCallback(classPtr); } - - private: - - static inline GemShape *GetMyClass(void *data) {return((GemShape *)((Obj_header *)data)->data);} - - ////////// - // static member functions - static void obj_setupCallback(t_class *classPtr); - static void linewidthMessCallback(void *data, t_floatarg linewidth); - static void typeMessCallback(void *data, t_symbol *type); - static void sizeMessCallback(void *data, t_floatarg size); - static void blendMessCallback(void *data, t_floatarg size); - - - protected: - int m_texType, m_texNum; - TexCoord*m_texCoords; - bool m_lighting; -}; - -#endif // for header file +/*----------------------------------------------------------------- +LOG + GEM - Graphics Environment for Multimedia + + Base class for shapes + + Copyright (c) 1997-1999 Mark Danks. mark@danks.org + Copyright (c) Günther Geiger. geiger@epy.co.at + Copyright (c) 2001-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at + For information on usage and redistribution, and for a DISCLAIMER OF ALL + WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. + +-----------------------------------------------------------------*/ + +#ifndef _INCLUDE__GEM_BASE_GEMSHAPE_H_ +#define _INCLUDE__GEM_BASE_GEMSHAPE_H_ + +#include "Base/GemBase.h" + +/*----------------------------------------------------------------- +------------------------------------------------------------------- +CLASS + GemShape + + Base class for shapes + +DESCRIPTION + + Inlet for a float - "ft1" + + "ft1" - the size of the shape + "draw" - the drawing style + "width" - the line width when drawing with lines + +-----------------------------------------------------------------*/ +class TexCoord; +class GEM_EXTERN GemShape : public GemBase +{ + public: + + ////////// + // Constructor + // [in] size - A size of 0. means to just use the default (ie, 1.) + GemShape(t_floatarg size); + GemShape(); + + protected: + + ////////// + // Destructor + virtual ~GemShape(); + + //----------------------------------- + // GROUP: Access functions + //----------------------------------- + + ////////// + // The width of the lines in line draw mode + void linewidthMess(float linewidth); + + ////////// + // The size of the object + void sizeMess(float size); + + ////////// + // How the object should be drawn + virtual void typeMess(t_symbol *type); + + //----------------------------------- + // GROUP: Utility functions + //----------------------------------- + + void SetVertex(GemState* state,float x, float y, float z, + float tx, float ty, + int curCoord); + + void SetVertex(GemState* state,float x, float y, float z, + float s, float t, float r, float q, + int curCoord); + + //----------------------------------- + // GROUP: Member variables + //----------------------------------- + + ////////// + // The line width for GL_LINE mode + GLfloat m_linewidth; + + ////////// + // The size of the object + GLfloat m_size; + + ////////// + // The drawing style (GL_LINE, GL_POLYGON, etc) + GLenum m_drawType; + + ////////// + // do we want blending? + GLboolean m_blend; + void blendMess(float blend); + + + //////// + // override this memberfunction to automatically enable softblended rendering,... + virtual void renderShape(GemState *state) {;} + + // OR + // override this memberfunction if you don't want softblending + virtual void render(GemState *state); + + + ////////// + // The size inlet + t_inlet *m_inlet; + + //----------------------------------- + // GROUP: Setup functions + //----------------------------------- + + ////////// + // creation callback + static void real_obj_setupCallback(t_class *classPtr) + { GemBase::real_obj_setupCallback(classPtr); GemShape::obj_setupCallback(classPtr); } + + private: + + static inline GemShape *GetMyClass(void *data) {return((GemShape *)((Obj_header *)data)->data);} + + ////////// + // static member functions + static void obj_setupCallback(t_class *classPtr); + static void linewidthMessCallback(void *data, t_floatarg linewidth); + static void typeMessCallback(void *data, t_symbol *type); + static void sizeMessCallback(void *data, t_floatarg size); + static void blendMessCallback(void *data, t_floatarg size); + + + protected: + int m_texType, m_texNum; + TexCoord*m_texCoords; + bool m_lighting; +}; + +#endif // for header file diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemState.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemState.h index d8ea046c..bb0a1075 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemState.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemState.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning GemState.h is deprecated - please include "Gem/State.h" instead -#endif -#include "Gem/State.h" +#ifdef __GNUC__ +# warning GemState.h is deprecated - please include "Gem/State.h" instead +#endif +#include "Gem/State.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemVector.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemVector.h index a235559e..a42488cf 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemVector.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemVector.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning GemVector.h is deprecated - please include "Utils/Vector.h" instead -#endif -#include "Utils/Vector.h" +#ifdef __GNUC__ +# warning GemVector.h is deprecated - please include "Utils/Vector.h" instead +#endif +#include "Utils/Vector.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemVersion.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemVersion.h index aec3de0a..821bc021 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemVersion.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemVersion.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning Base/GemVersion.h is deprecated - please include "Gem/Version.h" instead -#endif -#include "Gem/Version.h" +#ifdef __GNUC__ +# warning Base/GemVersion.h is deprecated - please include "Gem/Version.h" instead +#endif +#include "Gem/Version.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/GemWindow.h b/packages/noncvs/windows/extra/Gem/dev/Base/GemWindow.h index 7ac15d9f..584a1103 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/GemWindow.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/GemWindow.h @@ -1,208 +1,208 @@ -/*----------------------------------------------------------------- -LOG - GEM - Graphics Environment for Multimedia - - a window class to render to - - Copyright (c) 2009-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at - For information on usage and redistribution, and for a DISCLAIMER OF ALL - WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. - ------------------------------------------------------------------*/ - -#ifndef _INCLUDE__GEM_BASE_GEMWINDOW_H_ -#define _INCLUDE__GEM_BASE_GEMWINDOW_H_ - -#include "Gem/GemGL.h" -#include "Base/CPPExtern.h" - -#include -/*----------------------------------------------------------------- -------------------------------------------------------------------- -CLASS - GemWindow - - a window - -DESCRIPTION - ------------------------------------------------------------------*/ -namespace gem { - class Context; -}; - -class GEM_EXTERN GemWindow : public CPPExtern -{ - CPPEXTERN_HEADER(GemWindow, CPPExtern); - - private: - class PIMPL; - PIMPL*m_pimpl; - - public: - - ////////// - // Constructor - GemWindow(void); - - ////////// - // Destructor - virtual ~GemWindow(void); - - public: - /* OUTPUT */ - - /* an outlet to propagate information to the patch... mainly callbacks from the context */ - /* LATER think about detaching the output from the stack, so we can e.g. destroy a window from a mouse-callback */ - void info(std::vector); - void info(t_symbol*s, int, t_atom*); - void info(std::string); - void info(std::string, t_float); - void info(std::string, int i); - void info(std::string, std::string); - - /* tell downstream objects to render */ - void bang(void); - - /* mouse movement */ - void motion(int x, int y); - /* mouse buttons */ - void button(int id, int state); - /* keyboard buttons */ - // void key(std::string id, int state); - //void key(int id, int state); - void key(std::string, int, int state); - - /* window resize/move */ - void dimension(unsigned int, unsigned int); - void position (int, int); - - /* INPUT */ - - /* create a new context */ - static gem::Context*createContext(void); - /* destroy a given context; - * @returns NULL - */ - static gem::Context*destroyContext(gem::Context*); - - /* this MUST be called from the derived classes - * as it will eventually establish a new GemContext (if m_context is non-NULL) - * if you want to share GemContext's you MUST call - * GemWindow::createContext() yourself and set m_context to the result - * - * if false is returned, you should not continue - */ - bool createGemWindow(void); - /* create a new window - * make sure that this calls the parent's createContext() method - */ - virtual bool create(void) = 0; - - /* destroy an established context+infrastructuure * - * make sure that this get's called from your destroy() implementation - */ - void destroyGemWindow(); - /* create the current window - * make sure to call GemWindow::destroyGemWindow() - */ - virtual void destroy(void) = 0; - - /* make the object's context (window,...) the current context - * this is virtual, so objects can add their own code - * note however, that they should also call this (parent's) function within - * typically implementations look like this: - * bool ::makeCurrent(void) { - * // do your own stuff - * - * is false is returned, do not attempt to use it (e.g. draw into it) - */ - virtual bool makeCurrent(void) = 0; - - /* - * make the GemWindow current (reset stacks), switch multiContext - */ - bool pushContext(void); - /* - * make uncurrent - */ - bool popContext (void); - - /* swap back/front buffer - */ - virtual void swapBuffers(void) = 0; - - /* dispatch messages from the window - * this might get called more often than the render-cycle - * it might also be called automatically as soon as the window - * is create()ed (and until the window is destroy()ed) - */ - virtual void dispatch(void); - - /* render to this window - * the default implementation calls: - * if(!makeCurrent())return; - * if(!pushContext())return; - * bang(); - * if(m_buffer==2)swap(); - * popContext(); - * but you can override this, if you want to - */ - virtual void render(void); - - /* set/get the dimension of the context - * setting is done by supplying arguments to the method; - * querying is done by supplying NO arguments - * this should be kept throughout - */ - virtual void dimensionsMess(unsigned int width, unsigned int height) = 0; - - - // common property setters - // by default they will simply set the corresponding values (below in the protected section) - // to whatever argument is given them - // so you can use these values when creating the window - // however, if you need to take immediate action (e.g. because you can), you ought to override these functions - - /* render context (pre creation) */ - virtual void bufferMess(int buf); - virtual void fsaaMess(int value); - - /* window decoration (pre creation) */ - virtual void titleMess(std::string); - virtual void borderMess(bool on); - - virtual void fullscreenMess(int on); - virtual void offsetMess(int x, int y); - - /* creation/destruction */ - virtual void createMess(std::string); - virtual void destroyMess(void); - - /* post creation */ - virtual void cursorMess(bool on); - - /* print some info */ - virtual void printMess(void); - - protected: - unsigned int m_width, m_height; - - // common properties of GemWindow's - // you can safely ignore these, if they mean nothing to you - // however, if they do mean something to you, it would be good if you used these - int m_xoffset, m_yoffset; - bool m_border; - int m_fullscreen; - - unsigned int m_buffer; - std::string m_title; - bool m_cursor; - int m_fsaa; - - gem::Context* m_context; -}; - - - -#endif // for header file +/*----------------------------------------------------------------- +LOG + GEM - Graphics Environment for Multimedia + + a window class to render to + + Copyright (c) 2009-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at + For information on usage and redistribution, and for a DISCLAIMER OF ALL + WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. + +-----------------------------------------------------------------*/ + +#ifndef _INCLUDE__GEM_BASE_GEMWINDOW_H_ +#define _INCLUDE__GEM_BASE_GEMWINDOW_H_ + +#include "Gem/GemGL.h" +#include "Base/CPPExtern.h" + +#include +/*----------------------------------------------------------------- +------------------------------------------------------------------- +CLASS + GemWindow + + a window + +DESCRIPTION + +-----------------------------------------------------------------*/ +namespace gem { + class Context; +}; + +class GEM_EXTERN GemWindow : public CPPExtern +{ + CPPEXTERN_HEADER(GemWindow, CPPExtern); + + private: + class PIMPL; + PIMPL*m_pimpl; + + public: + + ////////// + // Constructor + GemWindow(void); + + ////////// + // Destructor + virtual ~GemWindow(void); + + public: + /* OUTPUT */ + + /* an outlet to propagate information to the patch... mainly callbacks from the context */ + /* LATER think about detaching the output from the stack, so we can e.g. destroy a window from a mouse-callback */ + void info(std::vector); + void info(t_symbol*s, int, t_atom*); + void info(std::string); + void info(std::string, t_float); + void info(std::string, int i); + void info(std::string, std::string); + + /* tell downstream objects to render */ + void bang(void); + + /* mouse movement */ + void motion(int x, int y); + /* mouse buttons */ + void button(int id, int state); + /* keyboard buttons */ + // void key(std::string id, int state); + //void key(int id, int state); + void key(std::string, int, int state); + + /* window resize/move */ + void dimension(unsigned int, unsigned int); + void position (int, int); + + /* INPUT */ + + /* create a new context */ + static gem::Context*createContext(void); + /* destroy a given context; + * @returns NULL + */ + static gem::Context*destroyContext(gem::Context*); + + /* this MUST be called from the derived classes + * as it will eventually establish a new GemContext (if m_context is non-NULL) + * if you want to share GemContext's you MUST call + * GemWindow::createContext() yourself and set m_context to the result + * + * if false is returned, you should not continue + */ + bool createGemWindow(void); + /* create a new window + * make sure that this calls the parent's createContext() method + */ + virtual bool create(void) = 0; + + /* destroy an established context+infrastructuure * + * make sure that this get's called from your destroy() implementation + */ + void destroyGemWindow(); + /* create the current window + * make sure to call GemWindow::destroyGemWindow() + */ + virtual void destroy(void) = 0; + + /* make the object's context (window,...) the current context + * this is virtual, so objects can add their own code + * note however, that they should also call this (parent's) function within + * typically implementations look like this: + * bool ::makeCurrent(void) { + * // do your own stuff + * + * is false is returned, do not attempt to use it (e.g. draw into it) + */ + virtual bool makeCurrent(void) = 0; + + /* + * make the GemWindow current (reset stacks), switch multiContext + */ + bool pushContext(void); + /* + * make uncurrent + */ + bool popContext (void); + + /* swap back/front buffer + */ + virtual void swapBuffers(void) = 0; + + /* dispatch messages from the window + * this might get called more often than the render-cycle + * it might also be called automatically as soon as the window + * is create()ed (and until the window is destroy()ed) + */ + virtual void dispatch(void); + + /* render to this window + * the default implementation calls: + * if(!makeCurrent())return; + * if(!pushContext())return; + * bang(); + * if(m_buffer==2)swap(); + * popContext(); + * but you can override this, if you want to + */ + virtual void render(void); + + /* set/get the dimension of the context + * setting is done by supplying arguments to the method; + * querying is done by supplying NO arguments + * this should be kept throughout + */ + virtual void dimensionsMess(unsigned int width, unsigned int height) = 0; + + + // common property setters + // by default they will simply set the corresponding values (below in the protected section) + // to whatever argument is given them + // so you can use these values when creating the window + // however, if you need to take immediate action (e.g. because you can), you ought to override these functions + + /* render context (pre creation) */ + virtual void bufferMess(int buf); + virtual void fsaaMess(int value); + + /* window decoration (pre creation) */ + virtual void titleMess(std::string); + virtual void borderMess(bool on); + + virtual void fullscreenMess(int on); + virtual void offsetMess(int x, int y); + + /* creation/destruction */ + virtual void createMess(std::string); + virtual void destroyMess(void); + + /* post creation */ + virtual void cursorMess(bool on); + + /* print some info */ + virtual void printMess(void); + + protected: + unsigned int m_width, m_height; + + // common properties of GemWindow's + // you can safely ignore these, if they mean nothing to you + // however, if they do mean something to you, it would be good if you used these + int m_xoffset, m_yoffset; + bool m_border; + int m_fullscreen; + + unsigned int m_buffer; + std::string m_title; + bool m_cursor; + int m_fsaa; + + gem::Context* m_context; +}; + + + +#endif // for header file diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/Matrix.h b/packages/noncvs/windows/extra/Gem/dev/Base/Matrix.h index cf8c8381..36e0024a 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/Matrix.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/Matrix.h @@ -1,4 +1,4 @@ -#ifdef __GNUC__ -# warning Matrix.h is deprecated - please include "Utils/Matrix.h" instead -#endif -#include "Utils/Matrix.h" +#ifdef __GNUC__ +# warning Matrix.h is deprecated - please include "Utils/Matrix.h" instead +#endif +#include "Utils/Matrix.h" diff --git a/packages/noncvs/windows/extra/Gem/dev/Base/TextBase.h b/packages/noncvs/windows/extra/Gem/dev/Base/TextBase.h index d2a029d6..27e67435 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Base/TextBase.h +++ b/packages/noncvs/windows/extra/Gem/dev/Base/TextBase.h @@ -1,231 +1,231 @@ -/*----------------------------------------------------------------- - LOG - GEM - Graphics Environment for Multimedia - - A text - - Copyright (c) 1997-1999 Mark Danks. mark@danks.org - Copyright (c) Günther Geiger. geiger@epy.co.at - Copyright (c) 2001-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at - Copyright (c) 2005 Georg Holzmann - For information on usage and redistribution, and for a DISCLAIMER OF ALL - WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. - - -----------------------------------------------------------------*/ - -#ifndef _INCLUDE__GEM_BASE_TEXTBASE_H_ -#define _INCLUDE__GEM_BASE_TEXTBASE_H_ - - -#ifdef _WIN32 -# pragma warning( disable : 4786 ) -# pragma warning( disable : 4788 ) -#endif - -#include "Gem/GemConfig.h" - -#include "Base/GemBase.h" - -#include -#include - -#ifdef FTGL -# define FONT_SCALE 0.2/3.0 -# ifdef HAVE_FTGL_FTGL_H -# include "FTGL/ftgl.h" -# else -# include "FTFont.h" -# endif -#else -# define FONT_SCALE 1.0 -#endif - -using std::vector; -using std::string; -using std::wstring; - -/*----------------------------------------------------------------- - ------------------------------------------------------------------- - CLASS - TextBase - - Base class for text objects - - DESCRIPTION - - "ft1" - The font size - "text" - The text to draw - - -----------------------------------------------------------------*/ -class GEM_EXTERN TextBase : public GemBase -{ - CPPEXTERN_HEADER(TextBase, GemBase); - - public: - - ////////// - // Constructor with args - TextBase(int argc, t_atom *argv); - - - protected: - - ////////// - // Destructor - virtual ~TextBase(); - - ////////// - // Do the rendering - virtual void render(GemState*); - - ////////// - // break a string according to '\n' - virtual void breakLine(wstring line); - - //-- moocow - ////////// - // Set the text string from an ASCII list - virtual void stringMess(int argc, t_atom *argv); - //-- /moocow - - ////////// - // Set the text string - virtual void textMess(int argc, t_atom *argv); - - ////////// - // The font to use - virtual void fontNameMess(const std::string filename); - - ////////// - // set line distance - virtual void linedistMess(float dist); - - ////////// - // Set the font size - virtual void setFontSize(float size); - virtual void setFontSize(); - - ////////// - // Set the precision for rendering - virtual void setPrecision(float prec); - - ////////// - // The different types of justification - enum JustifyWidth { LEFT, RIGHT, CENTER, BASEW }; - enum JustifyHeight { BOTTOM, TOP, MIDDLE, BASEH }; - enum JustifyDepth { FRONT, BACK, HALFWAY, BASED }; - - ////////// - // Set the justification - virtual void setJustification(JustifyWidth wType); - virtual void setJustification(JustifyWidth wType, JustifyHeight hType); - virtual void setJustification(JustifyWidth wType, JustifyHeight hType, JustifyDepth dType); - - ////////// - // do the justification - // x1,...,z2 just defines the bounding box of the rendered string. - // y_offset is the offset of the current line - virtual void justifyFont(float x1, float y1, float z1, - float x2, float y2, float z2, float y_offset=0); - - - //----------------------------------- - // GROUP: Member variables - //----------------------------------- - - ////////// - // The text to display - // (one entry for each line) - vector m_theText; - - ////////// - // distance between the lines - // (1 = 1 line, 0.5 = 0.5 lines, ...) - float m_dist; - - /////////// - // vector with the offset - // of the individual lines - vector m_lineDist; - - ////////// - // Do we have a valid font? - int m_valid; - - ////////// - // The font fize - float m_fontSize; - - ////////// - // The font depth (only for extruded fonts) - float m_fontDepth; - - ////////// - // The rendering precision - float m_precision; - - ////////// - // The width justification - JustifyWidth m_widthJus; - - ////////// - // The height justification - JustifyHeight m_heightJus; - - ////////// - // The depth justification - JustifyDepth m_depthJus; - - ////////// - // The inlet - t_inlet *m_inlet; - - - ////////// - // The default font name - static std::string DEFAULT_FONT; - - ////////// - // The font structure -#ifdef FTGL - FTFont *m_font; - /* this should delete (m_font) if it is notnull and recreate it. - * a pointer to the new structure is returned (and is set to m_font). - * if creation fails, the font is cleaned-up and NULL is returned - */ - virtual FTFont* makeFont(const char*fontname)=0; - - /* this is just handy to reload a font */ - t_symbol* m_fontname; - /* on starting to render, we reload the font, to make sure it is there - * this rids us of having to reload the font by hand everytime the rendering is restarted - */ - virtual void startRendering(void); - - /* render one line of the text */ - virtual void renderLine(const char*line,float dist); - virtual void renderLine(const wchar_t*line,float dist); -#endif - - private: - - /////////// - // helpers: - - /////////// - // helper to make the - // line distance vector - void makeLineDist(); - - ////////// - // Static member functions - static void textMessCallback(void *data, t_symbol *, int argc, t_atom *argv); - static void stringMessCallback(void *data, t_symbol *, int argc, t_atom *argv); //--moo - static void fontSizeMessCallback(void *data, t_floatarg size); - static void linedistMessCallback(void *data, t_floatarg dist); - static void precisionMessCallback(void *data, t_floatarg prec); - static void fontNameMessCallback(void *data, t_symbol *s); - static void justifyMessCallback(void *data, t_symbol *, int, t_atom*); -}; - -#endif // for header file +/*----------------------------------------------------------------- + LOG + GEM - Graphics Environment for Multimedia + + A text + + Copyright (c) 1997-1999 Mark Danks. mark@danks.org + Copyright (c) Günther Geiger. geiger@epy.co.at + Copyright (c) 2001-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at + Copyright (c) 2005 Georg Holzmann + For information on usage and redistribution, and for a DISCLAIMER OF ALL + WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. + + -----------------------------------------------------------------*/ + +#ifndef _INCLUDE__GEM_BASE_TEXTBASE_H_ +#define _INCLUDE__GEM_BASE_TEXTBASE_H_ + + +#ifdef _WIN32 +# pragma warning( disable : 4786 ) +# pragma warning( disable : 4788 ) +#endif + +#include "Gem/GemConfig.h" + +#include "Base/GemBase.h" + +#include +#include + +#ifdef FTGL +# define FONT_SCALE 0.2/3.0 +# ifdef HAVE_FTGL_FTGL_H +# include "FTGL/ftgl.h" +# else +# include "FTFont.h" +# endif +#else +# define FONT_SCALE 1.0 +#endif + +using std::vector; +using std::string; +using std::wstring; + +/*----------------------------------------------------------------- + ------------------------------------------------------------------- + CLASS + TextBase + + Base class for text objects + + DESCRIPTION + + "ft1" - The font size + "text" - The text to draw + + -----------------------------------------------------------------*/ +class GEM_EXTERN TextBase : public GemBase +{ + CPPEXTERN_HEADER(TextBase, GemBase); + + public: + + ////////// + // Constructor with args + TextBase(int argc, t_atom *argv); + + + protected: + + ////////// + // Destructor + virtual ~TextBase(); + + ////////// + // Do the rendering + virtual void render(GemState*); + + ////////// + // break a string according to '\n' + virtual void breakLine(wstring line); + + //-- moocow + ////////// + // Set the text string from an ASCII list + virtual void stringMess(int argc, t_atom *argv); + //-- /moocow + + ////////// + // Set the text string + virtual void textMess(int argc, t_atom *argv); + + ////////// + // The font to use + virtual void fontNameMess(const std::string filename); + + ////////// + // set line distance + virtual void linedistMess(float dist); + + ////////// + // Set the font size + virtual void setFontSize(float size); + virtual void setFontSize(); + + ////////// + // Set the precision for rendering + virtual void setPrecision(float prec); + + ////////// + // The different types of justification + enum JustifyWidth { LEFT, RIGHT, CENTER, BASEW }; + enum JustifyHeight { BOTTOM, TOP, MIDDLE, BASEH }; + enum JustifyDepth { FRONT, BACK, HALFWAY, BASED }; + + ////////// + // Set the justification + virtual void setJustification(JustifyWidth wType); + virtual void setJustification(JustifyWidth wType, JustifyHeight hType); + virtual void setJustification(JustifyWidth wType, JustifyHeight hType, JustifyDepth dType); + + ////////// + // do the justification + // x1,...,z2 just defines the bounding box of the rendered string. + // y_offset is the offset of the current line + virtual void justifyFont(float x1, float y1, float z1, + float x2, float y2, float z2, float y_offset=0); + + + //----------------------------------- + // GROUP: Member variables + //----------------------------------- + + ////////// + // The text to display + // (one entry for each line) + vector m_theText; + + ////////// + // distance between the lines + // (1 = 1 line, 0.5 = 0.5 lines, ...) + float m_dist; + + /////////// + // vector with the offset + // of the individual lines + vector m_lineDist; + + ////////// + // Do we have a valid font? + int m_valid; + + ////////// + // The font fize + float m_fontSize; + + ////////// + // The font depth (only for extruded fonts) + float m_fontDepth; + + ////////// + // The rendering precision + float m_precision; + + ////////// + // The width justification + JustifyWidth m_widthJus; + + ////////// + // The height justification + JustifyHeight m_heightJus; + + ////////// + // The depth justification + JustifyDepth m_depthJus; + + ////////// + // The inlet + t_inlet *m_inlet; + + + ////////// + // The default font name + static std::string DEFAULT_FONT; + + ////////// + // The font structure +#ifdef FTGL + FTFont *m_font; + /* this should delete (m_font) if it is notnull and recreate it. + * a pointer to the new structure is returned (and is set to m_font). + * if creation fails, the font is cleaned-up and NULL is returned + */ + virtual FTFont* makeFont(const char*fontname)=0; + + /* this is just handy to reload a font */ + t_symbol* m_fontname; + /* on starting to render, we reload the font, to make sure it is there + * this rids us of having to reload the font by hand everytime the rendering is restarted + */ + virtual void startRendering(void); + + /* render one line of the text */ + virtual void renderLine(const char*line,float dist); + virtual void renderLine(const wchar_t*line,float dist); +#endif + + private: + + /////////// + // helpers: + + /////////// + // helper to make the + // line distance vector + void makeLineDist(); + + ////////// + // Static member functions + static void textMessCallback(void *data, t_symbol *, int argc, t_atom *argv); + static void stringMessCallback(void *data, t_symbol *, int argc, t_atom *argv); //--moo + static void fontSizeMessCallback(void *data, t_floatarg size); + static void linedistMessCallback(void *data, t_floatarg dist); + static void precisionMessCallback(void *data, t_floatarg prec); + static void fontNameMessCallback(void *data, t_symbol *s); + static void justifyMessCallback(void *data, t_symbol *, int, t_atom*); +}; + +#endif // for header file -- cgit v1.2.1