This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 9e95a6d7dbef8989e1d78061312a28f906e8d685 (commit) via cbce1e498c7c03fa90abd5fd8ade80388efc1f3f (commit) via def0e21e1d79b55757534896fd810dbdd4019d95 (commit) via c5eee130375dd816b5e5a94ac24d9b2b5a4bf168 (commit) via 619a12314f7dee80aff4bdcdcabd4918300af001 (commit) via 05404f10c561c4820f7ade3ac02489baaedb33ea (commit) via d34bd097e24e5ed2ff2f741e0dd939c0450b7963 (commit) via 5df4db8d8a90ee2b6dc54b7648e6f410e3a77815 (commit) from 9910a9b5e922bd0493e5c76efb27474c4310ca34 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/gfxprim.git/commit/9e95a6d7dbef8989e1d78061312a28f906e8d68...
commit 9e95a6d7dbef8989e1d78061312a28f906e8d685 Author: Cyril Hrubis metan@ucw.cz Date: Sat Dec 19 23:01:38 2015 +0100
demos: c_simple: x11_windows: Fix SYS_RESIZE handling
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/demos/c_simple/x11_windows.c b/demos/c_simple/x11_windows.c index 1c5b2d0..aa37c7b 100644 --- a/demos/c_simple/x11_windows.c +++ b/demos/c_simple/x11_windows.c @@ -68,6 +68,8 @@ static int ev_loop(struct GP_Backend *backend, const char *name) switch (ev.code) { case GP_EV_SYS_RESIZE: GP_BackendResizeAck(backend); + redraw(backend->context); + GP_BackendFlip(backend); break; case GP_EV_SYS_QUIT: GP_BackendExit(backend);
http://repo.or.cz/gfxprim.git/commit/cbce1e498c7c03fa90abd5fd8ade80388efc1f3...
commit cbce1e498c7c03fa90abd5fd8ade80388efc1f3f Author: Cyril Hrubis metan@ucw.cz Date: Sat Dec 19 22:58:04 2015 +0100
demos: c_simple: virtual_backend_example: Handle SYS_RESIZE
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/demos/c_simple/virtual_backend_example.c b/demos/c_simple/virtual_backend_example.c index 5ef5a8e..f59f4ec 100644 --- a/demos/c_simple/virtual_backend_example.c +++ b/demos/c_simple/virtual_backend_example.c @@ -31,11 +31,61 @@
#include <GP.h>
+static GP_Pixel white_pixel, black_pixel, red_pixel, blue_pixel, green_pixel; + +static void redraw(GP_Backend *backend) +{ + GP_Context *context = backend->context; + + /* Now draw some testing patters */ + black_pixel = GP_RGBToContextPixel(0x00, 0x00, 0x00, context); + white_pixel = GP_RGBToContextPixel(0xff, 0xff, 0xff, context); + red_pixel = GP_RGBToContextPixel(0xff, 0x00, 0x00, context); + blue_pixel = GP_RGBToContextPixel(0x00, 0x00, 0xff, context); + green_pixel = GP_RGBToContextPixel(0x00, 0xff, 0x00, context); + + GP_Fill(context, white_pixel); + + unsigned int i, j; + for (i = 0; i < 40; i++) { + GP_HLineXYW(context, 0, i, i, black_pixel); + GP_HLineXYW(context, 1, i + 40, i, black_pixel); + GP_HLineXYW(context, 2, i + 80, i, black_pixel); + GP_HLineXYW(context, 3, i + 120, i, black_pixel); + GP_HLineXYW(context, 4, i + 160, i, black_pixel); + GP_HLineXYW(context, 5, i + 200, i, black_pixel); + GP_HLineXYW(context, 6, i + 240, i, black_pixel); + GP_HLineXYW(context, 7, i + 280, i, black_pixel); + } + + for (i = 0; i < 256; i++) { + for (j = 0; j < 256; j++) { + uint8_t val = 1.00 * sqrt(i*i + j*j)/sqrt(2) + 0.5; + + GP_Pixel pix = GP_RGBToContextPixel(i, j, val, context); + GP_PutPixel(context, i + 60, j + 10, pix); + } + } + + GP_Text(context, NULL, 60, 270, GP_VALIGN_BELOW|GP_ALIGN_RIGHT, + black_pixel, white_pixel, "Lorem Ipsum dolor sit..."); + + GP_Text(context, NULL, 60, 290, GP_VALIGN_BELOW|GP_ALIGN_RIGHT, + red_pixel, white_pixel, "Lorem Ipsum dolor sit..."); + + GP_Text(context, NULL, 60, 310, GP_VALIGN_BELOW|GP_ALIGN_RIGHT, + green_pixel, white_pixel, "Lorem Ipsum dolor sit..."); + + GP_Text(context, NULL, 60, 330, GP_VALIGN_BELOW|GP_ALIGN_RIGHT, + blue_pixel, white_pixel, "Lorem Ipsum dolor sit..."); + + /* Update the backend screen */ + GP_BackendFlip(backend); +} + int main(int argc, char *argv[]) { GP_Backend *backend; - GP_Context *context; - GP_Pixel white_pixel, black_pixel, red_pixel, blue_pixel, green_pixel; const char *backend_opts = "X11:350x350"; int opt; GP_PixelType emul_type = GP_PIXEL_UNKNOWN; @@ -90,52 +140,7 @@ int main(int argc, char *argv[]) backend = emul; }
- context = backend->context; - - /* Now draw some testing patters */ - black_pixel = GP_RGBToContextPixel(0x00, 0x00, 0x00, context); - white_pixel = GP_RGBToContextPixel(0xff, 0xff, 0xff, context); - red_pixel = GP_RGBToContextPixel(0xff, 0x00, 0x00, context); - blue_pixel = GP_RGBToContextPixel(0x00, 0x00, 0xff, context); - green_pixel = GP_RGBToContextPixel(0x00, 0xff, 0x00, context); - - GP_Fill(context, white_pixel); - - unsigned int i, j; - for (i = 0; i < 40; i++) { - GP_HLineXYW(context, 0, i, i, black_pixel); - GP_HLineXYW(context, 1, i + 40, i, black_pixel); - GP_HLineXYW(context, 2, i + 80, i, black_pixel); - GP_HLineXYW(context, 3, i + 120, i, black_pixel); - GP_HLineXYW(context, 4, i + 160, i, black_pixel); - GP_HLineXYW(context, 5, i + 200, i, black_pixel); - GP_HLineXYW(context, 6, i + 240, i, black_pixel); - GP_HLineXYW(context, 7, i + 280, i, black_pixel); - } - - for (i = 0; i < 256; i++) { - for (j = 0; j < 256; j++) { - uint8_t val = 1.00 * sqrt(i*i + j*j)/sqrt(2) + 0.5; - - GP_Pixel pix = GP_RGBToContextPixel(i, j, val, context); - GP_PutPixel(context, i + 60, j + 10, pix); - } - } - - GP_Text(context, NULL, 60, 270, GP_VALIGN_BELOW|GP_ALIGN_RIGHT, - black_pixel, white_pixel, "Lorem Ipsum dolor sit..."); - - GP_Text(context, NULL, 60, 290, GP_VALIGN_BELOW|GP_ALIGN_RIGHT, - red_pixel, white_pixel, "Lorem Ipsum dolor sit..."); - - GP_Text(context, NULL, 60, 310, GP_VALIGN_BELOW|GP_ALIGN_RIGHT, - green_pixel, white_pixel, "Lorem Ipsum dolor sit..."); - - GP_Text(context, NULL, 60, 330, GP_VALIGN_BELOW|GP_ALIGN_RIGHT, - blue_pixel, white_pixel, "Lorem Ipsum dolor sit..."); - - /* Update the backend screen */ - GP_BackendFlip(backend); + redraw(backend);
for (;;) { if (backend->Poll) @@ -159,6 +164,15 @@ int main(int argc, char *argv[]) return 0; break; } + break; + case GP_EV_SYS: + switch(ev.code) { + case GP_EV_SYS_RESIZE: + GP_BackendResizeAck(backend); + redraw(backend); + break; + } + break; } } }
http://repo.or.cz/gfxprim.git/commit/def0e21e1d79b55757534896fd810dbdd4019d9...
commit def0e21e1d79b55757534896fd810dbdd4019d95 Author: Cyril Hrubis metan@ucw.cz Date: Sat Dec 19 22:53:03 2015 +0100
demos: c_simple: textaligntest: Handle SYS_RESIZE
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/demos/c_simple/textaligntest.c b/demos/c_simple/textaligntest.c index 5e2fbd6..0c08140 100644 --- a/demos/c_simple/textaligntest.c +++ b/demos/c_simple/textaligntest.c @@ -144,6 +144,11 @@ static void event_loop(void) GP_BackendExit(win); exit(0); break; + case GP_EV_SYS_RESIZE: + GP_BackendResizeAck(win); + X = win->context->w; + Y = win->context->h; + break; } break; }
http://repo.or.cz/gfxprim.git/commit/c5eee130375dd816b5e5a94ac24d9b2b5a4bf16...
commit c5eee130375dd816b5e5a94ac24d9b2b5a4bf168 Author: Cyril Hrubis metan@ucw.cz Date: Sat Dec 19 22:49:43 2015 +0100
demos: c_simple: showimage: Handle SYS_RESIZE
Adds SYS_RESIZE event handling and centers the image in the window.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/demos/c_simple/showimage.c b/demos/c_simple/showimage.c index c78cff0..4934d4c 100644 --- a/demos/c_simple/showimage.c +++ b/demos/c_simple/showimage.c @@ -72,6 +72,19 @@ int main(int argc, char *argv[]) GP_BackendExit(backend); return 0; } + + if (ev.type == GP_EV_SYS && ev.code == GP_EV_SYS_RESIZE) { + int cx, cy; + + GP_BackendResizeAck(backend); + + cx = ((int)backend->context->w - (int)image->w) / 2; + cy = ((int)backend->context->h - (int)image->h) / 2; + + GP_Fill(backend->context, 0); + GP_Blit_Clipped(image, 0, 0, image->w, image->h, backend->context, cx, cy); + GP_BackendFlip(backend); + } }
return 0;
http://repo.or.cz/gfxprim.git/commit/619a12314f7dee80aff4bdcdcabd4918300af00...
commit 619a12314f7dee80aff4bdcdcabd4918300af001 Author: Cyril Hrubis metan@ucw.cz Date: Sat Dec 19 22:41:27 2015 +0100
demos: c_simple: fonttest: Handle SYS_RESIZE
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/demos/c_simple/fonttest.c b/demos/c_simple/fonttest.c index 9a3aff1..7d6a7ca 100644 --- a/demos/c_simple/fonttest.c +++ b/demos/c_simple/fonttest.c @@ -244,6 +244,16 @@ void event_loop(void) exit(0); break; } + break; + case GP_EV_SYS: + switch(ev.code) { + case GP_EV_SYS_RESIZE: + GP_BackendResizeAck(win); + redraw_screen(); + GP_BackendFlip(win); + break; + } + break; } } }
http://repo.or.cz/gfxprim.git/commit/05404f10c561c4820f7ade3ac02489baaedb33e...
commit 05404f10c561c4820f7ade3ac02489baaedb33ea Author: Cyril Hrubis metan@ucw.cz Date: Sat Dec 19 22:39:38 2015 +0100
demos: c_simple: fileview: Handle SYS_RESIZE
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/demos/c_simple/fileview.c b/demos/c_simple/fileview.c index 972514b..e33a74a 100644 --- a/demos/c_simple/fileview.c +++ b/demos/c_simple/fileview.c @@ -198,6 +198,11 @@ void event_loop(void) GP_BackendExit(backend); exit(0); break; + case GP_EV_SYS_RESIZE: + GP_BackendResizeAck(backend); + redraw_screen(); + GP_BackendFlip(backend); + break; } break; }
http://repo.or.cz/gfxprim.git/commit/d34bd097e24e5ed2ff2f741e0dd939c0450b796...
commit d34bd097e24e5ed2ff2f741e0dd939c0450b7963 Author: Cyril Hrubis metan@ucw.cz Date: Sat Dec 19 22:36:42 2015 +0100
demos: c_simple: blittest: Handle SYS_RESIZE
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/demos/c_simple/blittest.c b/demos/c_simple/blittest.c index ecdb39a..362ef8b 100644 --- a/demos/c_simple/blittest.c +++ b/demos/c_simple/blittest.c @@ -131,6 +131,11 @@ void event_loop(void) GP_BackendExit(win); exit(0); break; + case GP_EV_SYS_RESIZE: + GP_BackendResizeAck(win); + GP_Fill(win->context, black); + GP_BackendFlip(win); + break; } break; }
http://repo.or.cz/gfxprim.git/commit/5df4db8d8a90ee2b6dc54b7648e6f410e3a7781...
commit 5df4db8d8a90ee2b6dc54b7648e6f410e3a77815 Author: Cyril Hrubis metan@ucw.cz Date: Sat Dec 19 22:33:15 2015 +0100
demos: c_simple: koch: Handle SYS_RESIZE
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/demos/c_simple/koch.c b/demos/c_simple/koch.c index 5bb1538..27ce674 100644 --- a/demos/c_simple/koch.c +++ b/demos/c_simple/koch.c @@ -33,7 +33,7 @@
#include <GP.h>
-#define TIMER_TICK 10000 +#define TIMER_TICK 20000 #define DISPLAY_W 640 #define DISPLAY_H 480 #define sqr(x) ((x)*(x)) @@ -173,6 +173,10 @@ int main(void) return 0; break; } + break; + case GP_EV_SYS: + if (ev.code == GP_EV_SYS_RESIZE) + GP_BackendResizeAck(backend); } } usleep(TIMER_TICK);
-----------------------------------------------------------------------
Summary of changes: demos/c_simple/blittest.c | 5 ++ demos/c_simple/fileview.c | 5 ++ demos/c_simple/fonttest.c | 10 +++ demos/c_simple/koch.c | 6 +- demos/c_simple/showimage.c | 13 ++++ demos/c_simple/textaligntest.c | 5 ++ demos/c_simple/virtual_backend_example.c | 110 +++++++++++++++++-------------- demos/c_simple/x11_windows.c | 2 + 8 files changed, 107 insertions(+), 49 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.