guilib.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (c) 2009 Openmoko Inc.
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef GUILIB_H
  18. #define GUILIB_H
  19. /* to be provided by the hardware implementation */
  20. extern unsigned char *framebuffer;
  21. extern void fb_refresh();
  22. unsigned int guilib_framebuffer_width(void);
  23. unsigned int guilib_framebuffer_height(void);
  24. unsigned int guilib_framebuffer_size(void);
  25. /* implemented by guilib */
  26. void guilib_init(void);
  27. /* generic pixel value accessors
  28. * the get method is only needed by the simulators */
  29. void guilib_set_pixel(int x, int y, int v);
  30. int guilib_get_pixel(int x, int y);
  31. void guilib_invert(int start, int lines);
  32. void guilib_invert_area(unsigned int start_x, unsigned int start_y, unsigned int end_x, unsigned int end_y);
  33. void guilib_clear(void);
  34. void guilib_clear_area(unsigned int start_x, unsigned int start_y, unsigned int end_x, unsigned int end_y);
  35. /* functions for graphics context management */
  36. void guilib_fb_lock(void);
  37. void guilib_fb_unlock(void);
  38. struct guilib_image {
  39. unsigned int width;
  40. unsigned int height;
  41. char data[];
  42. };
  43. void guilib_blit_image(const struct guilib_image *img, int x, int y);
  44. #endif /* GUILIB_H */