aboutsummaryrefslogtreecommitdiffstats
path: root/src/gos/gos_qt.h
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@embedded.pro>2016-07-19 01:30:20 +0200
committerJoel Bodenmann <joel@embedded.pro>2016-07-19 01:30:20 +0200
commite5f69dbcf4d462cb94592a45a0d5ec1eefd14468 (patch)
treeeaddd90154afee8546694f527f4a21187f2a26cc /src/gos/gos_qt.h
parent038a1f3630a480cc9b2951e0af80b7a5dba58401 (diff)
downloaduGFX-e5f69dbcf4d462cb94592a45a0d5ec1eefd14468.tar.gz
uGFX-e5f69dbcf4d462cb94592a45a0d5ec1eefd14468.tar.bz2
uGFX-e5f69dbcf4d462cb94592a45a0d5ec1eefd14468.zip
Adding Qt GOS port
Diffstat (limited to 'src/gos/gos_qt.h')
-rw-r--r--src/gos/gos_qt.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/gos/gos_qt.h b/src/gos/gos_qt.h
new file mode 100644
index 00000000..9986d7f2
--- /dev/null
+++ b/src/gos/gos_qt.h
@@ -0,0 +1,78 @@
+/*
+ * This file is subject to the terms of the GFX License. If a copy of
+ * the license was not distributed with this file, you can obtain one at:
+ *
+ * http://ugfx.org/license.html
+ */
+
+#ifndef _GOS_QT_H
+#define _GOS_QT_H
+
+#if GFX_USE_OS_QT
+
+#include <stdint.h>
+#include <stddef.h>
+#include <stdbool.h>
+
+#define DECLARE_THREAD_FUNCTION(fnName, param) threadreturn_t fnName(void *param)
+#define DECLARE_THREAD_STACK(name, sz) uint8_t name[0]
+#define THREAD_RETURN(retval) return retval
+
+#define TIME_IMMEDIATE 0
+#define TIME_INFINITE ((delaytime_t)-1)
+#define MAX_SEMAPHORE_COUNT ((semcount_t)(((unsigned long)((semcount_t)(-1))) >> 1))
+#define LOW_PRIORITY 2
+#define NORMAL_PRIORITY 3
+#define HIGH_PRIORITY 4
+
+typedef bool bool_t;
+typedef int systemticks_t;
+typedef int delaytime_t;
+typedef void* gfxMutex;
+typedef void* gfxSem;
+typedef int semcount_t;
+typedef int threadreturn_t;
+typedef int threadpriority_t;
+typedef void* gfxThreadHandle;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _gosInit();
+void _gosDeinit();
+
+void gfxHalt(const char* msg);
+void gfxExit(void);
+void* gfxAlloc(size_t sz);
+void gfxFree(void* ptr);
+void gfxYield(void);
+void gfxSleepMilliseconds(delaytime_t ms);
+void gfxSleepMicroseconds(delaytime_t us);
+systemticks_t gfxSystemTicks(void);
+systemticks_t gfxMillisecondsToTicks(delaytime_t ms);
+void gfxSystemLock(void);
+void gfxSystemUnlock(void);
+void gfxMutexInit(gfxMutex *pmutex);
+void gfxMutexDestroy(gfxMutex *pmutex);
+void gfxMutexEnter(gfxMutex *pmutex);
+void gfxMutexExit(gfxMutex *pmutex);
+void gfxSemInit(gfxSem *psem, semcount_t val, semcount_t limit);
+void gfxSemDestroy(gfxSem *psem);
+bool_t gfxSemWait(gfxSem *psem, delaytime_t ms);
+bool_t gfxSemWaitI(gfxSem *psem);
+void gfxSemSignal(gfxSem *psem);
+void gfxSemSignalI(gfxSem *psem);
+semcount_t gfxSemCounter(gfxSem *psem);
+semcount_t gfxSemCounterI(gfxSem *psem);
+gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, threadpriority_t prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
+threadreturn_t gfxThreadWait(gfxThreadHandle thread);
+gfxThreadHandle gfxThreadMe(void);
+void gfxThreadClose(gfxThreadHandle thread);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GFX_USE_OS_QT */
+#endif /* _GOS_QT_H */