tasn pushed a commit to branch master. http://git.enlightenment.org/bindings/cxx/eflxx.git/commit/?id=c97f9972df511c4a1a17b4881afa2d7805edcb4a
commit c97f9972df511c4a1a17b4881afa2d7805edcb4a Author: Andreas Volz <li...@brachttal.net> Date: Mon Nov 30 22:07:43 2009 +0000 new emotionxx API SVN revision: 44073 --- emotionxx/include/emotionxx/Emotionxx.h | 13 +++++ emotionxx/include/emotionxx/EvasEmotion.h | 45 ----------------- emotionxx/include/emotionxx/Makefile.am | 2 +- emotionxx/include/emotionxx/Object.h | 45 +++++++++++++++++ emotionxx/src/EvasEmotion.cpp | 82 ------------------------------- emotionxx/src/Makefile.am | 2 +- emotionxx/src/Object.cpp | 78 +++++++++++++++++++++++++++++ 7 files changed, 138 insertions(+), 129 deletions(-) diff --git a/emotionxx/include/emotionxx/Emotionxx.h b/emotionxx/include/emotionxx/Emotionxx.h new file mode 100644 index 0000000..5de5ada --- /dev/null +++ b/emotionxx/include/emotionxx/Emotionxx.h @@ -0,0 +1,13 @@ +#ifndef EMOTIONXX_H +#define EMOTIONXX_H + +/* This is the main include header for Emotionxx. You should include it in your + * application. you could also use a combination of some headers and forward + * declarations to speed up compiling. But the default way is to simply + * #include "Emotionxx.h". + */ + +#include "Object.h" + +#endif // EMOTIONXX_H + diff --git a/emotionxx/include/emotionxx/EvasEmotion.h b/emotionxx/include/emotionxx/EvasEmotion.h deleted file mode 100644 index 34e4e10..0000000 --- a/emotionxx/include/emotionxx/EvasEmotion.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef EVAS_EMOTION_H -#define EVAS_EMOTION_H - - -/* EFL++ */ -#include <eflxx/eflpp_common.h> -#include <evasxx/EvasCanvas.h> -#include <evasxx/EvasObject.h> - -/* STD */ -#include <iostream> -using namespace std; - -/** - * C++ Wrapper for the Enlightenment Emotion Library (EMOTION) - * - * @author Michael 'Mickey' Lauer <mic...@vanille.de> - */ - -namespace efl { - -class EvasEmotion : public EvasObject -{ -public: - EvasEmotion( EvasCanvas &canvas, const std::string &module_filename ); - EvasEmotion( EvasCanvas &canvas, const std::string &filename, const std::string &module_filename ); - EvasEmotion( EvasCanvas &canvas, const Point &pos, const std::string &filename, const std::string &module_filename ); - EvasEmotion( EvasCanvas &canvas, const Rect &rect, const std::string &filename, const std::string &module_filename ); - ~EvasEmotion(); - - /** - * Initialize video engine to either use xine or gstreamer - * - * @param module_filename name of viedo engine to be used - */ - void engineInit(const std::string &module_filename); - - void setFile( const std::string &filename ); - void setPlay( bool b ); - void setSmoothScale( bool b ); -}; - -} - -#endif // EVAS_EMOTION_H diff --git a/emotionxx/include/emotionxx/Makefile.am b/emotionxx/include/emotionxx/Makefile.am index 7a2693b..c18fe8a 100644 --- a/emotionxx/include/emotionxx/Makefile.am +++ b/emotionxx/include/emotionxx/Makefile.am @@ -1,6 +1,6 @@ libemotionxx_HEADERS = \ - EvasEmotion.h + Object.h libemotionxxdir = \ $(pkgincludedir) diff --git a/emotionxx/include/emotionxx/Object.h b/emotionxx/include/emotionxx/Object.h new file mode 100644 index 0000000..71b4b47 --- /dev/null +++ b/emotionxx/include/emotionxx/Object.h @@ -0,0 +1,45 @@ +#ifndef EMOTIONXX_OBJECT_H +#define EMOTIONXX_OBJECT_H + + +/* EFL++ */ +#include <eflxx/Common.h> +#include <evasxx/Canvas.h> +#include <evasxx/Object.h> + +/* STD */ +#include <iostream> +using namespace std; + +/** + * C++ Wrapper for the Enlightenment Emotion Library (EMOTION) + * + * @author Michael 'Mickey' Lauer <mic...@vanille.de> + */ + +namespace Emotionxx { + +class Object : public Evasxx::Object +{ +public: + Object( Evasxx::Canvas &canvas, const std::string &module_filename ); + Object( Evasxx::Canvas &canvas, const std::string &filename, const std::string &module_filename ); + Object( Evasxx::Canvas &canvas, const Eflxx::Point &pos, const std::string &filename, const std::string &module_filename ); + Object( Evasxx::Canvas &canvas, const Eflxx::Rect &rect, const std::string &filename, const std::string &module_filename ); + ~Object(); + + /** + * Initialize video engine to either use xine or gstreamer + * + * @param module_filename name of viedo engine to be used + */ + void engineInit(const std::string &module_filename); + + void setFile( const std::string &filename ); + void setPlay( bool b ); + void setSmoothScale( bool b ); +}; + +} // end namespace Emotionxx + +#endif // EMOTIONXX_OBJECT_H diff --git a/emotionxx/src/EvasEmotion.cpp b/emotionxx/src/EvasEmotion.cpp deleted file mode 100644 index 400675f..0000000 --- a/emotionxx/src/EvasEmotion.cpp +++ /dev/null @@ -1,82 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - - -#include "../include/emotionxx/EvasEmotion.h" - -extern "C" { -#include <Emotion.h> -} - -#include <iostream> -#include <assert.h> - -using namespace std; - -namespace efl { - -//=============================================================================================== -// EvasEmotion -//=============================================================================================== - -EvasEmotion::EvasEmotion( EvasCanvas &canvas, const std::string &module_filename ) -{ - o = emotion_object_add( canvas.obj() ); - init(); - engineInit(module_filename); -} - -EvasEmotion::EvasEmotion( EvasCanvas &canvas, const std::string &filename, const std::string &module_filename ) -{ - o = emotion_object_add( canvas.obj() ); - init(); - engineInit(module_filename); - setFile( filename ); -} - -EvasEmotion::EvasEmotion( EvasCanvas &canvas, const Point &pos, const std::string &filename, const std::string &module_filename ) -{ - o = emotion_object_add( canvas.obj() ); - init( ); - engineInit(module_filename); - setFile( filename ); - move( pos ); -} - -EvasEmotion::EvasEmotion( EvasCanvas &canvas, const Rect &rect, const std::string &filename, const std::string &module_filename ) -{ - o = emotion_object_add( canvas.obj() ); - - init( ); - engineInit(module_filename); - setFile( filename ); - setGeometry (rect); -} - -void EvasEmotion::engineInit(const std::string &module_filename) -{ - if (!emotion_object_init(o, module_filename.c_str ())) - return; // FIXME: why a return here? -} - -void EvasEmotion::setFile( const std::string &filename ) -{ - emotion_object_file_set( o, filename.c_str () ); -} - -void EvasEmotion::setPlay( bool b ) -{ - emotion_object_play_set( o, b ); -} - -void EvasEmotion::setSmoothScale( bool b ) -{ - emotion_object_smooth_scale_set( o, b ); -} - -EvasEmotion::~EvasEmotion() -{ -} - -} diff --git a/emotionxx/src/Makefile.am b/emotionxx/src/Makefile.am index 0db67e8..9fe291a 100644 --- a/emotionxx/src/Makefile.am +++ b/emotionxx/src/Makefile.am @@ -16,7 +16,7 @@ lib_LTLIBRARIES = \ libemotionxx.la libemotionxx_la_SOURCES = \ - EvasEmotion.cpp + Object.cpp libemotionxx_la_LIBADD = \ $(EFL_LIBS) diff --git a/emotionxx/src/Object.cpp b/emotionxx/src/Object.cpp new file mode 100644 index 0000000..ada624c --- /dev/null +++ b/emotionxx/src/Object.cpp @@ -0,0 +1,78 @@ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + + +#include "../include/emotionxx/Object.h" + +extern "C" { +#include <Emotion.h> +} + +#include <iostream> +#include <assert.h> + +using namespace std; + +namespace Emotionxx { + +Object::Object( Evasxx::Canvas &canvas, const std::string &module_filename ) +{ + o = emotion_object_add( canvas.obj() ); + init(); + engineInit(module_filename); +} + +Object::Object( Evasxx::Canvas &canvas, const std::string &filename, const std::string &module_filename ) +{ + o = emotion_object_add( canvas.obj() ); + init(); + engineInit(module_filename); + setFile( filename ); +} + +Object::Object( Evasxx::Canvas &canvas, const Eflxx::Point &pos, const std::string &filename, const std::string &module_filename ) +{ + o = emotion_object_add( canvas.obj() ); + init( ); + engineInit(module_filename); + setFile( filename ); + move( pos ); +} + +Object::Object( Evasxx::Canvas &canvas, const Eflxx::Rect &rect, const std::string &filename, const std::string &module_filename ) +{ + o = emotion_object_add( canvas.obj() ); + + init( ); + engineInit(module_filename); + setFile( filename ); + setGeometry (rect); +} + +Object::~Object() +{ +} + +void Object::engineInit(const std::string &module_filename) +{ + if (!emotion_object_init(o, module_filename.c_str ())) + return; // FIXME: why a return here? +} + +void Object::setFile( const std::string &filename ) +{ + emotion_object_file_set( o, filename.c_str () ); +} + +void Object::setPlay( bool b ) +{ + emotion_object_play_set( o, b ); +} + +void Object::setSmoothScale( bool b ) +{ + emotion_object_smooth_scale_set( o, b ); +} + +} // end namespace Emotionxx --