summaryrefslogtreecommitdiff
path: root/apps/plugins/imageviewer
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2010-06-04 13:22:50 +0000
committerMichael Sevakis <jethead71@rockbox.org>2010-06-04 13:22:50 +0000
commite63e84a5dfb18e9b7eca8dabcd2d58ceac342529 (patch)
tree25989313fa6d7ea9f59ae8bdb1e56fe69f5e1a24 /apps/plugins/imageviewer
parentbc26fe7a96d6f5e443003cb871dcb4bfba525352 (diff)
downloadrockbox-e63e84a5dfb18e9b7eca8dabcd2d58ceac342529.zip
rockbox-e63e84a5dfb18e9b7eca8dabcd2d58ceac342529.tar.gz
rockbox-e63e84a5dfb18e9b7eca8dabcd2d58ceac342529.tar.bz2
rockbox-e63e84a5dfb18e9b7eca8dabcd2d58ceac342529.tar.xz
Convert some more stuff to mylcd_ and support pgfx as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26543 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/imageviewer')
-rw-r--r--apps/plugins/imageviewer/bmp/bmp.c2
-rw-r--r--apps/plugins/imageviewer/imageviewer.c22
-rw-r--r--apps/plugins/imageviewer/imageviewer.h8
-rw-r--r--apps/plugins/imageviewer/jpeg/jpeg.c2
4 files changed, 15 insertions, 19 deletions
diff --git a/apps/plugins/imageviewer/bmp/bmp.c b/apps/plugins/imageviewer/bmp/bmp.c
index 1229ac3..6b5c4b1 100644
--- a/apps/plugins/imageviewer/bmp/bmp.c
+++ b/apps/plugins/imageviewer/bmp/bmp.c
@@ -119,7 +119,7 @@ void draw_image_rect(struct image_info *info,
y + MAX(0, (LCD_HEIGHT-info->height)/2),
width, height);
#else
- MYXLCD(gray_bitmap_part)(
+ mylcd_ub_gray_bitmap_part(
pdisp->bitmap, info->x + x, info->y + y, info->width,
x + MAX(0, (LCD_WIDTH-info->width)/2),
y + MAX(0, (LCD_HEIGHT-info->height)/2),
diff --git a/apps/plugins/imageviewer/imageviewer.c b/apps/plugins/imageviewer/imageviewer.c
index ed41719..0fd25e7 100644
--- a/apps/plugins/imageviewer/imageviewer.c
+++ b/apps/plugins/imageviewer/imageviewer.c
@@ -416,10 +416,10 @@ static void pan_view_right(struct image_info *info)
move = MIN(HSCROLL, info->width - info->x - LCD_WIDTH);
if (move > 0)
{
- MYXLCD(scroll_left)(move); /* scroll left */
+ mylcd_ub_scroll_left(move); /* scroll left */
info->x += move;
draw_image_rect(info, LCD_WIDTH - move, 0, move, info->height-info->y);
- MYLCD_UPDATE();
+ mylcd_ub_update();
}
}
@@ -432,10 +432,10 @@ static void pan_view_left(struct image_info *info)
move = MIN(HSCROLL, info->x);
if (move > 0)
{
- MYXLCD(scroll_right)(move); /* scroll right */
+ mylcd_ub_scroll_right(move); /* scroll right */
info->x -= move;
draw_image_rect(info, 0, 0, move, info->height-info->y);
- MYLCD_UPDATE();
+ mylcd_ub_update();
}
}
@@ -448,7 +448,7 @@ static void pan_view_up(struct image_info *info)
move = MIN(VSCROLL, info->y);
if (move > 0)
{
- MYXLCD(scroll_down)(move); /* scroll down */
+ mylcd_ub_scroll_down(move); /* scroll down */
info->y -= move;
#if defined(HAVE_LCD_COLOR) && defined(JPEG_VIEWER)
if (settings.jpeg_dither_mode == DITHER_DIFFUSION)
@@ -459,7 +459,7 @@ static void pan_view_up(struct image_info *info)
}
#endif
draw_image_rect(info, 0, 0, info->width-info->x, move);
- MYLCD_UPDATE();
+ mylcd_ub_update();
}
}
@@ -472,7 +472,7 @@ static void pan_view_down(struct image_info *info)
move = MIN(VSCROLL, info->height - info->y - LCD_HEIGHT);
if (move > 0)
{
- MYXLCD(scroll_up)(move); /* scroll up */
+ mylcd_ub_scroll_up(move); /* scroll up */
info->y += move;
#if defined(HAVE_LCD_COLOR) && defined(JPEG_VIEWER)
if (settings.jpeg_dither_mode == DITHER_DIFFUSION)
@@ -499,7 +499,7 @@ static void pan_view_down(struct image_info *info)
info->y++;
}
#endif
- MYLCD_UPDATE();
+ mylcd_ub_update();
}
}
@@ -611,7 +611,7 @@ static int scroll_bmp(struct image_info *info)
#else
draw_image_rect(info, 0, 0,
info->width-info->x, info->height-info->y);
- MYLCD_UPDATE();
+ mylcd_ub_update();
#endif
break;
@@ -783,10 +783,10 @@ static int load_and_show(char* filename, struct image_info *info)
rb->lcd_update();
}
- MYLCD(clear_display)();
+ mylcd_ub_clear_display();
draw_image_rect(info, 0, 0,
info->width-info->x, info->height-info->y);
- MYLCD_UPDATE();
+ mylcd_ub_update();
#ifdef USEGSLIB
grey_show(true); /* switch on greyscale overlay */
diff --git a/apps/plugins/imageviewer/imageviewer.h b/apps/plugins/imageviewer/imageviewer.h
index b704701..5f22b03 100644
--- a/apps/plugins/imageviewer/imageviewer.h
+++ b/apps/plugins/imageviewer/imageviewer.h
@@ -366,16 +366,12 @@
#if LCD_DEPTH < 8
#define USEGSLIB
#include <lib/grey.h>
-#define MYLCD(fn) grey_ub_ ## fn
-#define MYLCD_UPDATE()
-#define MYXLCD(fn) grey_ub_ ## fn
#else
#include <lib/xlcd.h>
-#define MYLCD(fn) rb->lcd_ ## fn
-#define MYLCD_UPDATE() rb->lcd_update();
-#define MYXLCD(fn) xlcd_ ## fn
#endif
+#include <lib/mylcd.h>
+
/* Min memory allowing us to use the plugin buffer
* and thus not stopping the music
* *Very* rough estimation:
diff --git a/apps/plugins/imageviewer/jpeg/jpeg.c b/apps/plugins/imageviewer/jpeg/jpeg.c
index b16ec1c..95e493e 100644
--- a/apps/plugins/imageviewer/jpeg/jpeg.c
+++ b/apps/plugins/imageviewer/jpeg/jpeg.c
@@ -94,7 +94,7 @@ void draw_image_rect(struct image_info *info,
width, height,
settings.jpeg_colour_mode, settings.jpeg_dither_mode);
#else
- MYXLCD(gray_bitmap_part)(
+ mylcd_ub_gray_bitmap_part(
pdisp->bitmap[0], info->x + x, info->y + y, pdisp->stride,
x + MAX(0, (LCD_WIDTH-info->width)/2),
y + MAX(0, (LCD_HEIGHT-info->height)/2),