added ecore_job wrapper implementation
SVN revision: 48529
This commit is contained in:
parent
908d062498
commit
541bab2c07
|
@ -12,6 +12,7 @@
|
||||||
#include "EvasWindow.h"
|
#include "EvasWindow.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
#include "XWindow.h"
|
#include "XWindow.h"
|
||||||
|
#include "Job.h"
|
||||||
|
|
||||||
#endif // ECOREXX_H
|
#endif // ECOREXX_H
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
#ifndef ECORE_JOB_H
|
||||||
|
#define ECORE_JOB_H
|
||||||
|
|
||||||
|
/* EFL */
|
||||||
|
#include <Ecore.h>
|
||||||
|
|
||||||
|
#include <sigc++/sigc++.h>
|
||||||
|
|
||||||
|
namespace Ecorexx {
|
||||||
|
|
||||||
|
class Job
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/*!
|
||||||
|
* Add a job to the event queue.
|
||||||
|
*/
|
||||||
|
Job ();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Delete a queued job that has not yet been executed.
|
||||||
|
*/
|
||||||
|
virtual ~Job ();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Starts the job
|
||||||
|
*/
|
||||||
|
void start ();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Cancels the job if not yet runned
|
||||||
|
*/
|
||||||
|
void cancel ();
|
||||||
|
|
||||||
|
sigc::signal <void> signalCall;
|
||||||
|
|
||||||
|
private:
|
||||||
|
static void callback (void *data);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ecore_Job *mJob;
|
||||||
|
bool mCalled;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // end namespace Ecorexx
|
||||||
|
|
||||||
|
#endif // ECORE_JOB_H
|
|
@ -5,7 +5,8 @@ libecorexx_HEADERS = \
|
||||||
XWindow.h \
|
XWindow.h \
|
||||||
Animator.h \
|
Animator.h \
|
||||||
Timer.h \
|
Timer.h \
|
||||||
Ecorexx.h
|
Ecorexx.h \
|
||||||
|
Job.h
|
||||||
|
|
||||||
libecorexxdir = \
|
libecorexxdir = \
|
||||||
$(pkgincludedir)
|
$(pkgincludedir)
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
/* Project */
|
||||||
|
#include "../include/ecorexx/Job.h"
|
||||||
|
|
||||||
|
namespace Ecorexx {
|
||||||
|
|
||||||
|
Job::Job () :
|
||||||
|
mJob (NULL),
|
||||||
|
mCalled (false)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Job::~Job ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void Job::start ()
|
||||||
|
{
|
||||||
|
mJob = ecore_job_add (Job::callback, this);
|
||||||
|
mCalled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Job::cancel ()
|
||||||
|
{
|
||||||
|
if (mJob && !mCalled)
|
||||||
|
{
|
||||||
|
ecore_job_del (mJob);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Job::callback (void *data)
|
||||||
|
{
|
||||||
|
Job *job = static_cast <Job*> (data);
|
||||||
|
job->signalCall.emit ();
|
||||||
|
job->mCalled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // end namespace Ecorexx
|
|
@ -20,7 +20,8 @@ libecorexx_la_SOURCES = \
|
||||||
EvasWindow.cpp \
|
EvasWindow.cpp \
|
||||||
XWindow.cpp \
|
XWindow.cpp \
|
||||||
Animator.cpp \
|
Animator.cpp \
|
||||||
Timer.cpp
|
Timer.cpp \
|
||||||
|
Job.cpp
|
||||||
|
|
||||||
libecorexx_la_LIBADD = \
|
libecorexx_la_LIBADD = \
|
||||||
$(EFL_LIBS)
|
$(EFL_LIBS)
|
||||||
|
|
Loading…
Reference in New Issue