File loader utility
[Application utilities]

Collaboration diagram for File loader utility:

Functions

static void load_to_screen_worker (struct workqueue_task *task)
 Load file data directly to screen worker.
static void load_to_hugemem_worker (struct workqueue_task *task)
 Load file data to hugemem worker.
enum status_code load_file_to_screen (const char *filename, gfx_coord_t pos_x, gfx_coord_t pos_y, gfx_coord_t width, gfx_coord_t height, struct workqueue_task *done_task)
 Load file data directly to screen.
hugemem_ptr_t load_file_to_hugemem (const char *filename, struct workqueue_task *task)
 Allocate space in hugemem and load an image into it.
bool file_loader_busy ()
 Check if the file loader is busy loading a file.
void file_loader_init ()
 Initialize the file loader.

Detailed Description

This utility is used for loading files from a dataflash and directly to the screen or into hugemem.


Function Documentation

bool file_loader_busy (  ) 

Check if the file loader is busy loading a file.

Return values:
true when busy loading a file
false when not loading a file
void file_loader_init (  ) 

Initialize the file loader.

hugemem_ptr_t load_file_to_hugemem ( const char *  filename,
struct workqueue_task task 
)

Allocate space in hugemem and load an image into it.

This function will allocate enough space in hugemem to contain the image file and load the file from DataFlash and into the hugemem area allocated.

Parameters:
filename Name of a file on the file system
task Pointer to work queue task to callback when done loading
Returns:
hugemem pointer to file data or HUGEMEM_NULL if something went wrong

Referenced by app_fonts_load(), and tank_loader().

enum status_code load_file_to_screen ( const char *  filename,
gfx_coord_t  pos_x,
gfx_coord_t  pos_y,
gfx_coord_t  width,
gfx_coord_t  height,
struct workqueue_task done_task 
)

Load file data directly to screen.

This function opens a file from the DataFlash and loads the file data directly to the screen.

Parameters:
filename Name of file to load from file system.
pos_x X position on screen to start putting data
pos_y Y position on screen to start putting data
width Width in pixels for area to output data to
height Height in pixels for area to output data to
done_task Work queue task to callback when complete
Returns:
STATUS_OK if successful or status_code on error

Referenced by memgame_draw_piece(), slide_show_file(), and tank_loader().

static void load_to_hugemem_worker ( struct workqueue_task task  )  [static]

Load file data to hugemem worker.

This worker function puts the data fetched from the file system into the allocated hugemem section.

Parameters:
task Pointer to the current work queue task

Definition at line 155 of file file_loader.c.

References hugemem_write_block(), main_workqueue, min_u, myfs, STATUS_OK, tsfs_read(), and workqueue_add_task().

static void load_to_screen_worker ( struct workqueue_task task  )  [static]

Load file data directly to screen worker.

This worker function puts the data fetched from the file system directly to the screen.

Parameters:
task Pointer to the current work queue task

Definition at line 109 of file file_loader.c.

References gfx_get_height(), gfx_get_width(), gfx_put_pixmap, gfx_set_clipping(), main_workqueue, min_u, myfs, STATUS_OK, tsfs_read(), and workqueue_add_task().

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