aboutsummaryrefslogtreecommitdiffstats
path: root/include/gdisp
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2013-05-25 01:26:52 +1000
committerinmarket <andrewh@inmarket.com.au>2013-05-25 01:26:52 +1000
commit7fbfde42aabbcd30cffba2fba35158236c0a6c6c (patch)
treee85c90a4f21974b706315d64209021e0b2bde764 /include/gdisp
parent42006a67b5ccfd86f30d8a91cc474681c437eaf6 (diff)
downloaduGFX-7fbfde42aabbcd30cffba2fba35158236c0a6c6c.tar.gz
uGFX-7fbfde42aabbcd30cffba2fba35158236c0a6c6c.tar.bz2
uGFX-7fbfde42aabbcd30cffba2fba35158236c0a6c6c.zip
GOS module, for operating system independance
GMISC fast floating point trig GMISC fast fixed point trig
Diffstat (limited to 'include/gdisp')
-rw-r--r--include/gdisp/fonts.h1
-rw-r--r--include/gdisp/gdisp.h31
-rw-r--r--include/gdisp/image.h42
-rw-r--r--include/gdisp/lld/gdisp_lld_msgs.h24
4 files changed, 47 insertions, 51 deletions
diff --git a/include/gdisp/fonts.h b/include/gdisp/fonts.h
index ca175b77..881b90ad 100644
--- a/include/gdisp/fonts.h
+++ b/include/gdisp/fonts.h
@@ -12,7 +12,6 @@
* by the low level drivers that need to understand a font.
*
* @addtogroup GDISP
- *
* @{
*/
diff --git a/include/gdisp/gdisp.h b/include/gdisp/gdisp.h
index 8c14ca9f..c005f1e3 100644
--- a/include/gdisp/gdisp.h
+++ b/include/gdisp/gdisp.h
@@ -45,20 +45,6 @@ typedef int16_t coord_t;
/*===========================================================================*/
/**
- * @brief The type for a fixed point coordinate.
- * @details The top 16 bits are the integer component, the bottom 16 bits are the real component.
- */
-typedef int32_t fpcoord_t;
-
-/**
- * @brief Macros to convert to and from a fixed point coord.
- * @{
- */
-#define COORD2FP(x) ((fpcoord_t)(x)<<16)
-#define FP2COORD(x) ((coord_t)((x)>>16))
-/* @} */
-
-/**
* @brief Type for a 2D point on the screen.
*/
typedef struct point_t {
@@ -318,19 +304,6 @@ extern "C" {
/* Base Functions */
/**
- * @brief GDISP Driver initialization.
- * @details Must be called before any other gdisp function.
- *
- * @note This function is NOT currently implicitly invoked by @p halInit().
- * It must be called manually.
- *
- * @return True if succeeded, False otherwise
- *
- * @api
- */
- bool_t gdispInit(void);
-
- /**
* @brief Test if the GDISP engine is currently drawing.
* @note This function will always return FALSE if
* GDISP_NEED_ASYNC is not defined.
@@ -568,7 +541,6 @@ extern "C" {
#if GDISP_NEED_CONTROL || defined(__DOXYGEN__)
/**
* @brief Control hardware specific parts of the display. eg powermodes, backlight etc
- * @pre The GDISP unit must have been initialised using @p gdispInit().
* @note Depending on the hardware implementation this function may not
* support some codes. They will be ignored.
*
@@ -585,7 +557,6 @@ extern "C" {
#if GDISP_NEED_QUERY || defined(__DOXYGEN__)
/**
* @brief Query a property of the display.
- * @pre The GDISP unit must have been initialised using @p gdispInit().
* @note The result must be typecast to the correct type.
* @note An unsupported query will return (void *)-1.
*
@@ -601,7 +572,7 @@ extern "C" {
#include "gdisp/lld/gdisp_lld.h"
/* The same as above but use the low level driver directly if no multi-thread support is needed */
- #define gdispInit(gdisp) gdisp_lld_init()
+ #define _gdispInit(gdisp) gdisp_lld_init()
#define gdispIsBusy() FALSE
#define gdispClear(color) gdisp_lld_clear(color)
#define gdispDrawPixel(x, y, color) gdisp_lld_draw_pixel(x, y, color)
diff --git a/include/gdisp/image.h b/include/gdisp/image.h
index f169a0f1..5dcd9c56 100644
--- a/include/gdisp/image.h
+++ b/include/gdisp/image.h
@@ -129,19 +129,21 @@ extern "C" {
*/
bool_t gdispImageSetMemoryReader(gdispImage *img, const void *memimage);
- /**
- * @brief Sets the io fields in the image structure to routines
- * that support reading from an image stored on a BaseFileStream (eg SDCard).
- *
- * @return TRUE if the IO open function succeeds
- *
- * @param[in] img The image structure
- * @param[in] BaseFileStreamPtr A pointer to the (open) BaseFileStream object.
- *
- */
- bool_t gdispImageSetBaseFileStreamReader(gdispImage *img, void *BaseFileStreamPtr);
+ #if GFX_USE_OS_CHIBIOS || defined(__DOXYGEN__)
+ /**
+ * @brief Sets the io fields in the image structure to routines
+ * that support reading from an image stored on a BaseFileStream (eg SDCard).
+ *
+ * @return TRUE if the IO open function succeeds
+ *
+ * @param[in] img The image structure
+ * @param[in] BaseFileStreamPtr A pointer to the (open) BaseFileStream object.
+ *
+ */
+ bool_t gdispImageSetBaseFileStreamReader(gdispImage *img, void *BaseFileStreamPtr);
+ #endif
- #if defined(WIN32) || defined(__DOXYGEN__)
+ #if defined(WIN32) || GFX_USE_OS_WIN32 || GFX_USE_OS_POSIX || defined(__DOXYGEN__)
/**
* @brief Sets the io fields in the image structure to routines
* that support reading from an image stored in Win32 simulators native
@@ -154,7 +156,9 @@ extern "C" {
* @param[in] filename The filename to open
*
*/
- bool_t gdispImageSetSimulFileReader(gdispImage *img, const char *filename);
+ bool_t gdispImageSetFileReader(gdispImage *img, const char *filename);
+ /* Old definition */
+ #define gdispImageSetSimulFileReader(img, fname) gdispImageSetFileReader(img, fname)
#endif
/**
@@ -261,7 +265,7 @@ extern "C" {
* @note Calling gdispImageDraw() after getting a TIME_INFINITE will go back to drawing the first
* frame/page.
*/
- systime_t gdispImageNext(gdispImage *img);
+ delaytime_t gdispImageNext(gdispImage *img);
#if GDISP_NEED_IMAGE_NATIVE
/**
@@ -283,7 +287,7 @@ extern "C" {
void gdispImageClose_NATIVE(gdispImage *img);
gdispImageError gdispImageCache_NATIVE(gdispImage *img);
gdispImageError gdispImageDraw_NATIVE(gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy);
- systime_t gdispImageNext_NATIVE(gdispImage *img);
+ delaytime_t gdispImageNext_NATIVE(gdispImage *img);
/* @} */
#endif
@@ -299,7 +303,7 @@ extern "C" {
void gdispImageClose_GIF(gdispImage *img);
gdispImageError gdispImageCache_GIF(gdispImage *img);
gdispImageError gdispImageDraw_GIF(gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy);
- systime_t gdispImageNext_GIF(gdispImage *img);
+ delaytime_t gdispImageNext_GIF(gdispImage *img);
/* @} */
#endif
@@ -315,7 +319,7 @@ extern "C" {
void gdispImageClose_BMP(gdispImage *img);
gdispImageError gdispImageCache_BMP(gdispImage *img);
gdispImageError gdispImageDraw_BMP(gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy);
- systime_t gdispImageNext_BMP(gdispImage *img);
+ delaytime_t gdispImageNext_BMP(gdispImage *img);
/* @} */
#endif
@@ -331,7 +335,7 @@ extern "C" {
void gdispImageClose_JPG(gdispImage *img);
gdispImageError gdispImageCache_JPG(gdispImage *img);
gdispImageError gdispImageDraw_JPG(gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy);
- systime_t gdispImageNext_JPG(gdispImage *img);
+ delaytime_t gdispImageNext_JPG(gdispImage *img);
/* @} */
#endif
@@ -347,7 +351,7 @@ extern "C" {
void gdispImageClose_PNG(gdispImage *img);
gdispImageError gdispImageCache_PNG(gdispImage *img);
gdispImageError gdispImageDraw_PNG(gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy);
- systime_t gdispImageNext_PNG(gdispImage *img);
+ delaytime_t gdispImageNext_PNG(gdispImage *img);
/* @} */
#endif
diff --git a/include/gdisp/lld/gdisp_lld_msgs.h b/include/gdisp/lld/gdisp_lld_msgs.h
index de3d3035..91d8ed97 100644
--- a/include/gdisp/lld/gdisp_lld_msgs.h
+++ b/include/gdisp/lld/gdisp_lld_msgs.h
@@ -59,26 +59,34 @@ typedef enum gdisp_msgaction {
} gdisp_msgaction_t;
typedef union gdisp_lld_msg {
- gdisp_msgaction_t action;
+ struct {
+ gfxQueueItem qi;
+ gdisp_msgaction_t action;
+ };
struct gdisp_lld_msg_init {
+ gfxQueueItem qi;
gdisp_msgaction_t action; // GDISP_LLD_MSG_INIT
} init;
struct gdisp_lld_msg_clear {
+ gfxQueueItem qi;
gdisp_msgaction_t action; // GDISP_LLD_MSG_CLEAR
color_t color;
} clear;
struct gdisp_lld_msg_drawpixel {
+ gfxQueueItem qi;
gdisp_msgaction_t action; // GDISP_LLD_MSG_DRAWPIXEL
coord_t x, y;
color_t color;
} drawpixel;
struct gdisp_lld_msg_fillarea {
+ gfxQueueItem qi;
gdisp_msgaction_t action; // GDISP_LLD_MSG_FILLAREA
coord_t x, y;
coord_t cx, cy;
color_t color;
} fillarea;
struct gdisp_lld_msg_blitarea {
+ gfxQueueItem qi;
gdisp_msgaction_t action; // GDISP_LLD_MSG_BLITAREA
coord_t x, y;
coord_t cx, cy;
@@ -87,41 +95,48 @@ typedef union gdisp_lld_msg {
const pixel_t *buffer;
} blitarea;
struct gdisp_lld_msg_setclip {
+ gfxQueueItem qi;
gdisp_msgaction_t action; // GDISP_LLD_MSG_SETCLIP
coord_t x, y;
coord_t cx, cy;
} setclip;
struct gdisp_lld_msg_drawline {
+ gfxQueueItem qi;
gdisp_msgaction_t action; // GDISP_LLD_MSG_DRAWLINE
coord_t x0, y0;
coord_t x1, y1;
color_t color;
} drawline;
struct gdisp_lld_msg_drawcircle {
+ gfxQueueItem qi;
gdisp_msgaction_t action; // GDISP_LLD_MSG_DRAWCIRCLE
coord_t x, y;
coord_t radius;
color_t color;
} drawcircle;
struct gdisp_lld_msg_fillcircle {
+ gfxQueueItem qi;
gdisp_msgaction_t action; // GDISP_LLD_MSG_FILLCIRCLE
coord_t x, y;
coord_t radius;
color_t color;
} fillcircle;
struct gdisp_lld_msg_drawellipse {
+ gfxQueueItem qi;
gdisp_msgaction_t action; // GDISP_LLD_MSG_DRAWELLIPSE
coord_t x, y;
coord_t a, b;
color_t color;
} drawellipse;
struct gdisp_lld_msg_fillellipse {
+ gfxQueueItem qi;
gdisp_msgaction_t action; // GDISP_LLD_MSG_FILLELLIPSE
coord_t x, y;
coord_t a, b;
color_t color;
} fillellipse;
struct gdisp_lld_msg_drawarc {
+ gfxQueueItem qi;
gdisp_msgaction_t action; // GDISP_LLD_MSG_DRAWARC
coord_t x, y;
coord_t radius;
@@ -129,6 +144,7 @@ typedef union gdisp_lld_msg {
color_t color;
} drawarc;
struct gdisp_lld_msg_fillarc {
+ gfxQueueItem qi;
gdisp_msgaction_t action; // GDISP_LLD_MSG_FILLARC
coord_t x, y;
coord_t radius;
@@ -136,6 +152,7 @@ typedef union gdisp_lld_msg {
color_t color;
} fillarc;
struct gdisp_lld_msg_drawchar {
+ gfxQueueItem qi;
gdisp_msgaction_t action; // GDISP_LLD_MSG_DRAWCHAR
coord_t x, y;
char c;
@@ -143,6 +160,7 @@ typedef union gdisp_lld_msg {
color_t color;
} drawchar;
struct gdisp_lld_msg_fillchar {
+ gfxQueueItem qi;
gdisp_msgaction_t action; // GDISP_LLD_MSG_FILLCHAR
coord_t x, y;
char c;
@@ -151,11 +169,13 @@ typedef union gdisp_lld_msg {
color_t bgcolor;
} fillchar;
struct gdisp_lld_msg_getpixelcolor {
+ gfxQueueItem qi;
gdisp_msgaction_t action; // GDISP_LLD_MSG_GETPIXELCOLOR
coord_t x, y;
color_t result;
} getpixelcolor;
struct gdisp_lld_msg_verticalscroll {
+ gfxQueueItem qi;
gdisp_msgaction_t action; // GDISP_LLD_MSG_VERTICALSCROLL
coord_t x, y;
coord_t cx, cy;
@@ -163,11 +183,13 @@ typedef union gdisp_lld_msg {
color_t bgcolor;
} verticalscroll;
struct gdisp_lld_msg_control {
+ gfxQueueItem qi;
gdisp_msgaction_t action; // GDISP_LLD_MSG_CONTROL
int what;
void * value;
} control;
struct gdisp_lld_msg_query {
+ gfxQueueItem qi;
gdisp_msgaction_t action; // GDISP_LLD_MSG_QUERY
int what;
void * result;