modtronix H / modtronix_im4OLED

Fork of Adafruit_GFX by Neal Horman

Revision:
23:44309099c532
Parent:
22:f63aeb3769b5
Child:
26:ef08580c35df
--- a/mx_gfx.h	Tue Oct 20 17:18:02 2015 +1100
+++ b/mx_gfx.h	Wed Oct 21 14:49:56 2015 +1100
@@ -20,7 +20,7 @@
 #ifndef _ADAFRUIT_GFX_H_
 #define _ADAFRUIT_GFX_H_
 
-#include "im4oled_config.h"
+#include "im4oled_default_config.h"
 
 static inline void swap(int16_t &a, int16_t &b)
 {
@@ -70,71 +70,71 @@
     virtual int _putc(int value) { return writeChar(value); };
     virtual int _getc() { return -1; };
 
-#ifdef GFX_ENABLE_ABSTRACTS
+#if (GFX_ENABLE_ABSTRACTS==1)
     // these are 'generic' drawing functions, so we can share them!
     
     /** Draw a Horizontal Line
-     * @note GFX_ENABLE_ABSTRACTS must be defined in Adafruit_GFX_config.h
+     * @note GFX_ENABLE_ABSTRACTS must be defined in im4oled_config.h
      */
     virtual void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
     /** Draw a rectangle
-     * @note GFX_ENABLE_ABSTRACTS must be defined in Adafruit_GFX_config.h
+     * @note GFX_ENABLE_ABSTRACTS must be defined in im4oled_config.h
      */
     virtual void drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
     /** Fill the entire display
-     * @note GFX_ENABLE_ABSTRACTS must be defined in Adafruit_GFX_config.h
+     * @note GFX_ENABLE_ABSTRACTS must be defined in im4oled_config.h
      */
     virtual void fillScreen(uint16_t color);
 
     /** Draw a circle
-     * @note GFX_ENABLE_ABSTRACTS must be defined in Adafruit_GFX_config.h
+     * @note GFX_ENABLE_ABSTRACTS must be defined in im4oled_config.h
      */
     void drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
     void drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, uint16_t color);
     
     /** Draw and fill a circle
-     * @note GFX_ENABLE_ABSTRACTS must be defined in Adafruit_GFX_config.h
+     * @note GFX_ENABLE_ABSTRACTS must be defined in im4oled_config.h
      */
     void fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
     void fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, int16_t delta, uint16_t color);
 
     /** Draw a triangle
-     * @note GFX_ENABLE_ABSTRACTS must be defined in Adafruit_GFX_config.h
+     * @note GFX_ENABLE_ABSTRACTS must be defined in im4oled_config.h
      */
     void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
     /** Draw and fill a triangle
-     * @note GFX_ENABLE_ABSTRACTS must be defined in Adafruit_GFX_config.h
+     * @note GFX_ENABLE_ABSTRACTS must be defined in im4oled_config.h
      */
     void fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
     
     /** Draw a rounded rectangle
-     * @note GFX_ENABLE_ABSTRACTS must be defined in Adafruit_GFX_config.h
+     * @note GFX_ENABLE_ABSTRACTS must be defined in im4oled_config.h
      */
     void drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);
     /** Draw and fill a rounded rectangle
-     * @note GFX_ENABLE_ABSTRACTS must be defined in Adafruit_GFX_config.h
+     * @note GFX_ENABLE_ABSTRACTS must be defined in im4oled_config.h
      */
     void fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);
     /** Draw a bitmap
-     * @note GFX_ENABLE_ABSTRACTS must be defined in Adafruit_GFX_config.h
+     * @note GFX_ENABLE_ABSTRACTS must be defined in im4oled_config.h
      */
     void drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color);
 #endif
 
-#if defined(GFX_ENABLE_ABSTRACTS) || defined(GFX_SIZEABLE_TEXT)
+#if (GFX_ENABLE_ABSTRACTS==1) || (GFX_SIZEABLE_TEXT==1)
 
     /** Draw a line
-     * @note GFX_ENABLE_ABSTRACTS or GFX_SIZEABLE_TEXT must be defined in Adafruit_GFX_config.h
+     * @note GFX_ENABLE_ABSTRACTS or GFX_SIZEABLE_TEXT must be defined in im4oled_config.h
      */
     virtual void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);
 
     /** Draw a vertical line
-     * @note GFX_ENABLE_ABSTRACTS or GFX_SIZEABLE_TEXT must be defined in Adafruit_GFX_config.h
+     * @note GFX_ENABLE_ABSTRACTS or GFX_SIZEABLE_TEXT must be defined in im4oled_config.h
      */
     virtual void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
 
     /** Draw and fill a rectangle. The rectangle starts at given point, and extends DOWN(h) and RIGHTH(w)
-     * @note GFX_ENABLE_ABSTRACTS or GFX_SIZEABLE_TEXT must be defined in Adafruit_GFX_config.h
+     * @note GFX_ENABLE_ABSTRACTS or GFX_SIZEABLE_TEXT must be defined in im4oled_config.h
      *
      * @param x X coordinate, a value from 0 - (width-1)
      * @param y Y coordinate, a value from 0 - (height-1)
@@ -163,7 +163,7 @@
      */
     inline void setTextCursor(int16_t x, int16_t y) { cursor_x = x; cursor_y = y; };
 
-#if defined(GFX_ENABLE_ABSTRACTS) || defined(GFX_SIZEABLE_TEXT)
+#if (GFX_ENABLE_ABSTRACTS==1) || (GFX_SIZEABLE_TEXT==1)
     /** Set the size of the text to be drawn
      * @note Make sure to enable either GFX_SIZEABLE_TEXT or GFX_ENABLE_ABSTRACTS
      */