wl-keyboard.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright (c) 2009 Openmoko Inc.
  3. *
  4. * Authors Holger Hans Peter Freyther <zecke@openmoko.org>
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef WL_KEYBOARD_H
  20. #define WL_KEYBOARD_H
  21. /**
  22. * keyboard functionality
  23. */
  24. #define KEYBOARD_WIDTH 240
  25. #define KEYBOARD_HEIGHT 82
  26. enum {
  27. KEYBOARD_NONE,
  28. KEYBOARD_CHAR,
  29. KEYBOARD_NUM,
  30. KEYBOARD_CLEAR_HISTORY,
  31. KEYBOARD_RESTRICTED,
  32. KEYBOARD_PASSWORD_CHAR,
  33. KEYBOARD_PASSWORD_NUM,
  34. KEYBOARD_FILTER_ON_OFF,
  35. KEYBOARD_FILTER_OPTION
  36. };
  37. enum {
  38. KEYBOARD_RESET_INVERT_DELAY,
  39. KEYBOARD_RESET_INVERT_NOW,
  40. KEYBOARD_RESET_INVERT_CHECK
  41. };
  42. struct keyboard_key {
  43. /*
  44. * a rect described by top left and
  45. * bottom right point.
  46. */
  47. int left_x, right_x;
  48. int left_y, right_y;
  49. char key;
  50. };
  51. void keyboard_set_mode(int mode);
  52. int keyboard_get_mode();
  53. unsigned int keyboard_height();
  54. void keyboard_paint();
  55. struct keyboard_key * keyboard_get_data(int x, int y);
  56. void keyboard_key_invert(struct keyboard_key *key);
  57. int keyboard_key_reset_invert(int bFlag, unsigned long ev_time);
  58. int keyboard_key_inverted(void);
  59. int keyboard_adjacent_keys(struct keyboard_key *key1, struct keyboard_key *key2);
  60. #endif