summaryrefslogtreecommitdiffstats
path: root/apps/plugins/lib/simple_viewer.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lib/simple_viewer.c')
-rw-r--r--apps/plugins/lib/simple_viewer.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/apps/plugins/lib/simple_viewer.c b/apps/plugins/lib/simple_viewer.c
index 4c05ee68c5..0b554e054d 100644
--- a/apps/plugins/lib/simple_viewer.c
+++ b/apps/plugins/lib/simple_viewer.c
@@ -27,10 +27,8 @@
struct view_info {
-#ifdef HAVE_LCD_BITMAP
struct font* pf;
struct viewport scrollbar_vp; /* viewport for scrollbar */
-#endif
struct viewport vp;
const char *title;
const char *text; /* displayed text */
@@ -89,15 +87,12 @@ static void calc_line_count(struct view_info *info)
{
const char *ptr = info->text;
int i = 0;
-#ifdef HAVE_LCD_BITMAP
bool scrollbar = false;
-#endif
while (*ptr)
{
ptr = get_next_line(ptr, info);
i++;
-#ifdef HAVE_LCD_BITMAP
if (!scrollbar && i > info->display_lines)
{
ptr = info->text;
@@ -111,7 +106,6 @@ static void calc_line_count(struct view_info *info)
info->scrollbar_vp.x = info->vp.width;
scrollbar = true;
}
-#endif
}
info->line_count = i;
}
@@ -144,12 +138,8 @@ static int init_view(struct view_info *info,
const char *title, const char *text)
{
rb->viewport_set_defaults(&info->vp, SCREEN_MAIN);
-#ifdef HAVE_LCD_BITMAP
info->pf = rb->font_get(FONT_UI);
info->display_lines = info->vp.height / info->pf->height;
-#else
- info->display_lines = info->vp.height;
-#endif
info->title = title;
info->text = text;
@@ -157,7 +147,6 @@ static int init_view(struct view_info *info,
info->line = 0;
info->start = 0;
-#ifdef HAVE_LCD_BITMAP
/* no title for small screens. */
if (info->display_lines < 4)
{
@@ -169,7 +158,6 @@ static int init_view(struct view_info *info,
info->vp.y += info->pf->height;
info->vp.height -= info->pf->height;
}
-#endif
calc_line_count(info);
return 0;
@@ -177,11 +165,7 @@ static int init_view(struct view_info *info,
static void draw_text(struct view_info *info)
{
-#ifdef HAVE_LCD_BITMAP
#define OUTPUT_SIZE LCD_WIDTH+1
-#else
-#define OUTPUT_SIZE LCD_WIDTH*3+1
-#endif
static char output[OUTPUT_SIZE];
const char *text, *ptr;
int max_show, line;
@@ -190,14 +174,12 @@ static void draw_text(struct view_info *info)
/* clear screen */
display->clear_display();
-#ifdef HAVE_LCD_BITMAP
/* display title. */
if(info->title)
{
display->set_viewport(NULL);
display->puts(0, 0, info->title);
}
-#endif
max_show = MIN(info->line_count - info->line, info->display_lines);
text = info->text + info->start;
@@ -215,7 +197,6 @@ static void draw_text(struct view_info *info)
display->puts(0, line, output);
text = ptr;
}
-#ifdef HAVE_LCD_BITMAP
if (info->line_count > info->display_lines)
{
display->set_viewport(&info->scrollbar_vp);
@@ -224,7 +205,6 @@ static void draw_text(struct view_info *info)
info->line_count, info->line, info->line + max_show,
VERTICAL);
}
-#endif
display->set_viewport(NULL);
display->update();