Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Copyright 2009 Vincent Sanders <vince@simtec.co.uk>
  3.  *
  4.  * This file is part of libnsfb, http://www.netsurf-browser.org/
  5.  * Licenced under the MIT License,
  6.  *                http://www.opensource.org/licenses/mit-license.php
  7.  */
  8.  
  9. #include <stdbool.h>
  10. #include <stdio.h>
  11.  
  12. #include "libnsfb.h"
  13. #include "libnsfb_plot.h"
  14. #include "libnsfb_event.h"
  15. #include "nsfb.h"
  16. #include "surface.h"
  17.  
  18. #define UNUSED(x) ((x) = (x))
  19.  
  20. static int able_set_geometry(nsfb_t *nsfb, int width, int height, enum nsfb_format_e format)
  21. {
  22.     if (nsfb->surface_priv != NULL)
  23.         return -1; /* if were already initialised fail */
  24.  
  25.     nsfb->width = width;
  26.     nsfb->height = height;
  27.     nsfb->format = format;
  28.  
  29.     return 0;
  30. }
  31.  
  32. static int able_initialise(nsfb_t *nsfb)
  33. {
  34.     UNUSED(nsfb);
  35.     return 0;
  36. }
  37.  
  38. static int able_finalise(nsfb_t *nsfb)
  39. {
  40.     UNUSED(nsfb);
  41.     return 0;
  42. }
  43.  
  44. static bool able_input(nsfb_t *nsfb, nsfb_event_t *event, int timeout)
  45. {
  46.     UNUSED(nsfb);
  47.     UNUSED(event);
  48.     UNUSED(timeout);
  49.     return false;
  50. }
  51.  
  52. const nsfb_surface_rtns_t able_rtns = {
  53.     .initialise = able_initialise,
  54.     .finalise = able_finalise,
  55.     .input = able_input,
  56.     .geometry = able_set_geometry,
  57. };
  58.  
  59. NSFB_SURFACE_DEF(able, NSFB_SURFACE_ABLE, &able_rtns)
  60.