SET (OYRANOS_VERSION_MINOR 9)
SET (OYRANOS_VERSION_MICRO 5)
-SET (OYRANOS_DEVEL_MONTH 12)
-SET (OYRANOS_DEVEL_YEAR 2013)
+SET (OYRANOS_DEVEL_MONTH 01)
+SET (OYRANOS_DEVEL_YEAR 2014)
SET (PACKAGE_NAME "oyranos")
SET (PACKAGE_DESCRIPTION "Oyranos is a Color Management System (CMS) on operating system level. It allows to match predictably input device colors to output device colors across supporting applications. One goal is to make color management useful for all users in a automated fashion and regardless of any technical knowledge.")
Oy_Fl_Image_Widget * box;
};
-void callback ( Fl_Widget* w, void* daten )
+#include "../../liboyranos_core/oyranos_threads.c"
+void update(void*daten)
+{
+ struct box_n_opts * arg = (box_n_opts*) daten;
+
+#if 0
+ ((Fl_Widget*)arg->box)->damage(FL_DAMAGE_ALL,arg->box->x(),arg->box->y(),arg->box->w(),arg->box->h());
+ arg->box->damage_resize(arg->box->x(),arg->box->y(),arg->box->w(),arg->box->h());
+#else
+ arg->box->deactivate();
+ arg->box->activate();
+#endif
+}
+
+extern "C" {
+void * id_worker ( void* daten )
{
struct box_n_opts * arg = (box_n_opts*) daten;
oyStruct_s * object = (oyStruct_s*) arg->node;
- if(!w->parent())
- printf("Could not find parents.\n");
- else
- if(!object)
- printf("Oyranos argument missed.\n");
- else
- if(object && object->type_ == oyOBJECT_FILTER_NODE_S)
{
oyFilterNode_s * node = (oyFilterNode_s*) object;
oyOptions_s * opts = 0,
*/
arg->box->damage( FL_DAMAGE_USER1 );
+ Fl::awake(update,arg);
+
delete [] command;
}
+ return NULL;
+}
+}
+
+void callback ( Fl_Widget* w, void* daten )
+{
+ struct box_n_opts * arg = (box_n_opts*) daten;
+ oyStruct_s * object = (oyStruct_s*) arg->node;
+ oyThread_t thread;
+
+ if(!w->parent())
+ printf("Could not find parents.\n");
+ else
+ if(!object)
+ printf("Oyranos argument missed.\n");
+ else
+ if(object && object->type_ == oyOBJECT_FILTER_NODE_S)
+ oyThreadCreate( id_worker, daten, &thread );
else
printf("could not find a suitable program structure\n");
}
--- /dev/null
+/** @file oyranos_threads.h
+ *
+ * Oyranos is an open source Color Management System
+ *
+ * @par Copyright:
+ * 2014 (C) Kai-Uwe Behrmann
+ *
+ * @brief thread methods
+ * @internal
+ * @par License:
+ * new BSD <http://www.opensource.org/licenses/bsd-license.php>
+ * @since 2014/01/24
+ *
+ * This file contains functions for thread handling.
+ */
+
+#ifndef OYRANOS_THREADS_H
+#define OYRANOS_THREADS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#if defined(WIN32) && !defined(__GNU__)
+# include <process.h>
+typedef CRITICAL_SECTION oyMutex_t;
+# define oyMutexInit_m(m,a) InitializeCriticalSection(m)
+# define oyMutexLock_m(m) EnterCriticalSection(m)
+# define oyMutexUnLock_m(m) LeaveCriticalSection(m)
+# define oyMutexDestroy_m(m) DeleteCriticalSection(m)
+typedef unsigned long oyThread_t;
+#else
+# include <pthread.h>
+typedef pthread_mutex_t oyMutex_t;
+# define oyMutexInit_m(m,a) pthread_mutex_init(m,a)
+# define oyMutexLock_m(m) pthread_mutex_lock(m)
+# define oyMutexUnLock_m(m) pthread_mutex_unlock(m)
+# define oyMutexDestroy_m(m) pthread_mutex_destroy(m)
+typedef pthread_t oyThread_t;
+int oyThreadCreate ( void *(*func) (void * data),
+ void * data,
+ oyThread_t * thread );
+#endif
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+#endif /* OYRANOS_THREADS_H */
--- /dev/null
+/** @file oyranos_threads.c
+ *
+ * Oyranos is an open source Color Management System
+ *
+ * @par Copyright:
+ * 2014 (C) Kai-Uwe Behrmann
+ *
+ * @brief thread methods
+ * @internal
+ * @par License:
+ * new BSD <http://www.opensource.org/licenses/bsd-license.php>
+ * @since 2014/01/24
+ *
+ * This file contains functions for thread handling.
+ */
+
+#include "oyranos_threads.h"
+
+#include "oyranos_internal.h"
+#include "oyranos_helper.h"
+#include "oyranos_debug.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @brief start a thread with a given function
+ *
+ * @version Oyranos: 0.9.5
+ * @date 2014/01/25
+ * @since 2014/01/25 (Oyranos: 0.9.5)
+ */
+int oyThreadCreate ( void *(*func) (void * ptr),
+ void * data,
+ oyThread_t * thread )
+{
+ int error = !thread || !func;
+
+ if(!error)
+ {
+#if defined(WIN32) && !defined(__GNU__)
+ *thread = (oyThread_t) _beginthread( func, 0, data );
+ if(!(*thread))
+ error = 1;
+#else
+ pthread_attr_t attr;
+ error = pthread_attr_init( &attr );
+ error = pthread_create( thread, &attr, func, data );
+ error = pthread_attr_destroy( &attr );
+#endif
+ }
+
+ return error;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+