aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@seriouslyembedded.com>2016-02-10 23:30:24 +0100
committerJoel Bodenmann <joel@seriouslyembedded.com>2016-02-10 23:30:24 +0100
commit23e04c480322709648533e6f79658805b1d43a97 (patch)
treeff472a168450fbebeb46a316c04b112e6bcf84c0
parentf28e9d9eef51776b7ed9dfe573d39776c7336049 (diff)
parent507fb2d57e2d76d4a268e664efd3c59431132061 (diff)
downloaduGFX-23e04c480322709648533e6f79658805b1d43a97.tar.gz
uGFX-23e04c480322709648533e6f79658805b1d43a97.tar.bz2
uGFX-23e04c480322709648533e6f79658805b1d43a97.zip
Merge branch 'master' of https://bitbucket.org/Tectu/ugfx
-rw-r--r--boards/base/Linux-Framebuffer/board_framebuffer.h2
-rw-r--r--boards/base/RaspberryPi/readme.txt13
-rw-r--r--docs/releases.txt1
-rw-r--r--src/gwin/gwin_frame.c16
-rw-r--r--src/gwin/gwin_frame.h7
5 files changed, 24 insertions, 15 deletions
diff --git a/boards/base/Linux-Framebuffer/board_framebuffer.h b/boards/base/Linux-Framebuffer/board_framebuffer.h
index e1836527..9b760e08 100644
--- a/boards/base/Linux-Framebuffer/board_framebuffer.h
+++ b/boards/base/Linux-Framebuffer/board_framebuffer.h
@@ -123,7 +123,7 @@
}
if (fb_var.red.offset != LLDCOLOR_SHIFT_R || fb_var.green.offset != LLDCOLOR_SHIFT_G || fb_var.blue.offset != LLDCOLOR_SHIFT_B) {
#if LLDCOLOR_SHIFT_B == 0
- fprintf(stderr, "GDISP Framebuffer: THe display pixel format is not RGB\n");
+ fprintf(stderr, "GDISP Framebuffer: The display pixel format is not RGB\n");
#else
fprintf(stderr, "GDISP Framebuffer: The display pixel format is not BGR\n");
#endif
diff --git a/boards/base/RaspberryPi/readme.txt b/boards/base/RaspberryPi/readme.txt
index d4a59bf2..6ff2246f 100644
--- a/boards/base/RaspberryPi/readme.txt
+++ b/boards/base/RaspberryPi/readme.txt
@@ -1,15 +1,20 @@
-This directory contains the interface for the Raspberry Pi framebuffer.
+This directory contains the interface for the Raspberry Pi direct hardware framebuffer.
This talks directly to the raspberry pi hardware (not via a linux framebuffer driver).
+If you are using linux on the Pi then consider using the linux-X or the linux-Framebuffer
+board definitions instead of this one. This is really designed for non-Linux platforms
+or where there is no linux display driver available. It will still work under linux but
+the other solutions might be better.
+
This graphics interface is software driven - it is not an accelerated interface.
-This board definition should work on any operating system that will work on the Raspberry Pi
- eg. Linux, FreeRTOS.
+The board definition should work on any operating system that will work on the Raspberry Pi
+ eg. Linux, FreeRTOS, FreeBSD.
On this board uGFX currently supports:
- GDISP via the framebuffer driver
-THe following variables may optionally be defined in your gfxconf.h or your makefile...
+The following variables may optionally be defined in your gfxconf.h or your makefile...
- GDISP_LLD_PIXELFORMAT default = GDISP_PIXELFORMAT_RGB565
- GDISP_SCREEN_WIDTH default = 800
- GDISP_SCREEN_HEIGHT default = 600
diff --git a/docs/releases.txt b/docs/releases.txt
index 5f0b693b..e3a2326e 100644
--- a/docs/releases.txt
+++ b/docs/releases.txt
@@ -10,6 +10,7 @@ FEATURE: Added Altera-MAX10-NEEK board support
FIX: Vastly improving keyboard widget default rendering
FEATURE: Added ILI9342 driver
FIX: Fixing issues where wrong 'progress' color from widget style palette was used
+FEATURE: Added GWIN_FRAME_KEEPONCLOSE flag to prevent destruction of a frame on close
*** Release 2.4 ***
diff --git a/src/gwin/gwin_frame.c b/src/gwin/gwin_frame.c
index 28d7c01d..a9abbb9b 100644
--- a/src/gwin/gwin_frame.c
+++ b/src/gwin/gwin_frame.c
@@ -28,11 +28,11 @@
#define FRM_BORDER_B 2 // Bottom Border
/* Internal state flags */
-#define GWIN_FRAME_USER_FLAGS (GWIN_FRAME_CLOSE_BTN|GWIN_FRAME_MINMAX_BTN)
-#define GWIN_FRAME_CLOSE_PRESSED (GWIN_FRAME_MINMAX_BTN << 1)
-#define GWIN_FRAME_MIN_PRESSED (GWIN_FRAME_MINMAX_BTN << 2)
-#define GWIN_FRAME_MAX_PRESSED (GWIN_FRAME_MINMAX_BTN << 3)
-#define GWIN_FRAME_REDRAW_FRAME (GWIN_FRAME_MINMAX_BTN << 4) // Only redraw the frame
+#define GWIN_FRAME_USER_FLAGS (GWIN_FRAME_CLOSE_BTN|GWIN_FRAME_MINMAX_BTN|GWIN_FRAME_KEEPONCLOSE)
+#define GWIN_FRAME_CLOSE_PRESSED (GWIN_FRAME_KEEPONCLOSE << 1)
+#define GWIN_FRAME_MIN_PRESSED (GWIN_FRAME_KEEPONCLOSE << 2)
+#define GWIN_FRAME_MAX_PRESSED (GWIN_FRAME_KEEPONCLOSE << 3)
+#define GWIN_FRAME_REDRAW_FRAME (GWIN_FRAME_KEEPONCLOSE << 4) // Only redraw the frame
#if GWIN_FRAME_CLOSE_BTN < GWIN_FIRST_CONTROL_FLAG
#error "GWIN Frame: - Flag definitions don't match"
#endif
@@ -96,7 +96,8 @@ static void forceFrameRedraw(GWidgetObject *gw) {
gw->g.flags &= ~(GWIN_FRAME_CLOSE_PRESSED|GWIN_FRAME_MAX_PRESSED|GWIN_FRAME_MIN_PRESSED);
forceFrameRedraw(gw);
_gwinSendEvent(&gw->g, GEVENT_GWIN_CLOSE);
- _gwinDestroy(&gw->g, REDRAW_INSESSION);
+ if (!(gw->g.flags & GWIN_FRAME_KEEPONCLOSE))
+ _gwinDestroy(&gw->g, REDRAW_INSESSION);
return;
}
if ((gw->g.flags & GWIN_FRAME_MAX_PRESSED)) {
@@ -129,7 +130,8 @@ static void forceFrameRedraw(GWidgetObject *gw) {
gw->g.flags &= ~(GWIN_FRAME_CLOSE_PRESSED|GWIN_FRAME_MAX_PRESSED|GWIN_FRAME_MIN_PRESSED);
forceFrameRedraw(gw);
_gwinSendEvent(&gw->g, GEVENT_GWIN_CLOSE);
- _gwinDestroy(&gw->g, REDRAW_INSESSION);
+ if (!(gw->g.flags & GWIN_FRAME_KEEPONCLOSE))
+ _gwinDestroy(&gw->g, REDRAW_INSESSION);
return;
}
pos -= FRM_BUTTON_X;
diff --git a/src/gwin/gwin_frame.h b/src/gwin/gwin_frame.h
index 18af2e50..45c97b53 100644
--- a/src/gwin/gwin_frame.h
+++ b/src/gwin/gwin_frame.h
@@ -31,9 +31,10 @@
* @brief Flags for gwinFrameCreate()
* @{
*/
-#define GWIN_FRAME_BORDER 0x00000000 // Deprecated. A border is always shown with a frame window now.
-#define GWIN_FRAME_CLOSE_BTN 0x00000001
-#define GWIN_FRAME_MINMAX_BTN 0x00000002
+#define GWIN_FRAME_BORDER 0x00000000 /**< Deprecated. A border is always shown with a frame window now. */
+#define GWIN_FRAME_CLOSE_BTN 0x00000001 /**< Should a close button be shown? */
+#define GWIN_FRAME_MINMAX_BTN 0x00000002 /**< Should minimize and maximize buttons be shown? */
+#define GWIN_FRAME_KEEPONCLOSE 0x00000004 /**< Don't automatically destroy the frame on close */
/** @} */
typedef GContainerObject GFrameObject;