Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 

46 рядки
1.2 KiB

  1. /*
  2. * neercs console-based window manager
  3. * Copyright (c) 2009-2010 Jean-Yves Lamoureux <jylam@lnxscene.org>
  4. * All Rights Reserved
  5. *
  6. * This program is free software. It comes without any warranty, to
  7. * the extent permitted by applicable law. You can redistribute it
  8. * and/or modify it under the terms of the Do What The Fuck You Want
  9. * To Public License, Version 2, as published by Sam Hocevar. See
  10. * http://www.wtfpl.net/ for more details.
  11. */
  12. #include <stdio.h>
  13. #include <string.h>
  14. #include <stdlib.h>
  15. #include <sys/types.h>
  16. #include <caca.h>
  17. enum input_box_code
  18. {
  19. INPUT_BOX_ESC,
  20. INPUT_BOX_RET,
  21. INPUT_BOX_NOTHING,
  22. };
  23. struct input_box
  24. {
  25. caca_canvas_t *cv;
  26. int x, y;
  27. int w, h;
  28. int size;
  29. char *command;
  30. char *output_err;
  31. char *output_res;
  32. };
  33. struct input_box *widget_ibox_init(caca_canvas_t * cv, int w, int h);
  34. int widget_ibox_draw(struct input_box *box);
  35. int widget_ibox_handle_key(struct input_box *box, unsigned int c);
  36. char* widget_ibox_get_text(struct input_box *box);
  37. void widget_ibox_destroy(struct input_box *box);
  38. void widget_ibox_set_error(struct input_box *box, char *err);
  39. void widget_ibox_set_msg(struct input_box *box, char *msg);