/* display.h
 *
 * Renders the displays.
 *
 * (c) 2006, Joseph Curtis
 */

#include "x86.h"


#ifndef x86
#include "graphics.h"
#endif


#define STATUS_BAR_HEIGHT 32

/* view types */
#define VIEW_MENU 0
#define VIEW_MAIN 1
#define VIEW_MAP 2

struct view {
  int type; /* the view type */
#ifndef x86
  Image *image; /* the image to display */
#endif
  void *func; /* function to call to update */
};

struct display {
  int current_view; /* Which display the screen is currently looking at. */
  int num_views; /* number of displays */
  struct view *views; /* array of displays */
};


/**
 * Update a view and it's corresponding crap on teh screen
 *
 * @param d The display containing the view to update.
 * @param v The view to update.
 * @param data The data to update the view with.
 * 
 * @return 1 on success, NULL on failure.
 */
int update_view(struct display *d, int v, void *data);


/**
 * Updates the current view in the display
 *
 * @param d Display to update current view.
 *
 * @return 1 on success, NULL on failure.
 */
int update(struct display *d, void *data);


/**
 * Update the main view
 */
int update_main(struct display *d, void *data);

/**
 * Update the menu view
 */
int update_menu(struct display *d, void *data);

/**
 * Update the map view
 */
int update_map(struct display *d, void *data);

/**
 * Set up the default display.  Temporary for getting it going.
 */
int setup_default_display();

/**
 * Destroy the default display.
 */
int destroy_default_display();

/**
 * Paint a beveled box to the image.
 */
//void beveled_box(int x, int y, int width, int height, Image *i);

/**
 * Print some text to the screen
 */
void putText(int x, int y, char * text);

