A GUI dispatcher for asynchronous updates with Ecore

24 01 2008

First time I tried to get some data from a asynchronous source in an Edje application it was really hard to find out how to do it. For that reason I wrote two interfaces (C and C++) that helps to ease that task and are flexible enough for most cases. The C version has no other dependencies and the C++ version has only libsigc++ as dependency (beside Ecore of course). The licence is BSD. Have fun with it.

Here is the C version:
ecore_dispatcher.h
ecore_dispatcher.c

Here is the C++ version (not depend on the C version!)
EcoreDispatcher.h
EcoreDispatcher.cpp

Example: (needs Joystick.cpp)

EcoreDispatcher m_buttonDispatcher;
EcoreDispatcher m_axisDispatcher;

m_axisDispatcher.signalDispatch.connect (sigc::mem_fun (this, &ControlManager::onJoystickAxis));
m_buttonDispatcher.signalDispatch.connect (sigc::mem_fun (this, &ControlManager::onJoystickButton));

void ControlManager::onJoystickAxis (int missedEvents)
{
  // dispatched callback
}

void ControlManager::onJoystickButton (int missedEvents)
{
  // dispatched callback
}

Copyright (C) 2008 Andreas Volz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies of the Software and its Copyright notices. In addition publicly
documented acknowledgment must be given that this software has been used if no
source code of this software is made available publicly. This includes
acknowledgments in either Copyright notices, Manuals, Publicity and Marketing
documents or any documentation provided with any product containing this
software. This License does not apply to any software that links to the
libraries provided by this software (statically or dynamically), but only to
the software provided.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Advertisements

Actions

Information

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: