apps/display-demo/app_files.c File Reference

Display Xplained file details application. More...

#include <stream.h>
#include <string.h>
#include <workqueue.h>
#include <gfx/gfx.h>
#include <gfx/win.h>
#include <gfx/wtk.h>
#include <gfx/sysfont.h>
#include <fs/tsfs.h>
#include "app_files.h"
#include <mainloop.h>
#include "app_desktop.h"
#include "file_loader.h"

Go to the source code of this file.

Data Structures

struct  app_files
 The files application context. More...

Defines

#define FONT_HEADER_SIZE   16
 Number of bytes in the header for the font files loaded from the TSFS.
#define FILE_NAMES_PER_PAGE   8
 Number of files to present size information per page.
Color scheme

#define COLOR_TEXT   GFX_COLOR(250, 250, 250)
 Color on text strings.
#define COLOR_TEXT_SHADED   GFX_COLOR(150, 150, 150)
 Color on shaded text strings.
#define COLOR_BACKGROUND   GFX_COLOR(0, 0, 0)
 Background color.
#define COLOR_LINE   GFX_COLOR(48, 120, 158)
 Color on horizontal lines.
Text appearance

#define TEXT_HEADER_HEIGHT   30
 Height of common screen header in pixels.
#define TEXT_INDENT   5
 Number of pixels to indent a string.
#define TEXT_PADDING   3
 Number of pixels to add in front of a string.
#define TEXT_PADDING_NEWLINE   2
 Number of pixels for space after newline.

Enumerations

enum  app_files_page_numbers {
  PAGE_NUM_BLANK = 1, PAGE_NUM_FIRST = 2, PAGE_NUM_INTRO_SCREEN = PAGE_NUM_FIRST, PAGE_NUM_INFO_SCREEN,
  PAGE_NUM_LAST = PAGE_NUM_INFO_SCREEN
}
 

File demo application static page numbers.

More...
enum  app_files_button_ids { BUTTON_NEXT_ID = 1, BUTTON_PREV_ID, BUTTON_QUIT_ID }
 

Event command ID for the application widgets.

More...

Functions

static void string_file_size (char *file_size_str, uint32_t size, size_t str_size)
 Format a file size into a string.
static void screen_draw_introduction (void)
 Draw file system introduction page.
static void screen_draw_file_system_info (void)
 Draw file system information page.
static void screen_draw_file_list_from_index (uint_fast8_t index)
 Draw a list of files from file entry index.
static void app_files_frame_draw_handler (struct win_window *win, const struct win_clip_region *clip)
 Frame draw handler handling draw events.
static bool app_files_frame_command_handler (struct wtk_basic_frame *frame, win_command_t command_data)
 Frame command handler handling the button events.
static void app_files_load_worker (struct workqueue_task *task)
 Setup the font object after loading the font from the file system.
void app_files_launch (struct workqueue_task *task)
 Launch the files and string formatting application.

Variables

struct tsfs myfs
 TSFS control struct, needed for file listing.
static struct app_filesthe_app_files
 The files application context pointer.
static struct font font_fixedrus
 Fixed point russian font object.

Detailed Description

Display Xplained file details application.

Copyright (C) 2010 Atmel Corporation. All rights reserved.

Definition in file app_files.c.

Generated on Thu Apr 29 14:09:58 2010 for display-demo by  doxygen 1.6.3