25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 

50 satır
1.3 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://sam.zoy.org/wtfpl/COPYING for more details.
  11. */
  12. #if defined HAVE_CONFIG_H
  13. # include "config.h"
  14. #endif
  15. #include <stdio.h>
  16. #include <string.h>
  17. #include <stdlib.h>
  18. #include <sys/types.h>
  19. #include <caca.h>
  20. enum input_box_code
  21. {
  22. INPUT_BOX_ESC,
  23. INPUT_BOX_RET,
  24. INPUT_BOX_NOTHING,
  25. };
  26. struct input_box
  27. {
  28. caca_canvas_t *cv;
  29. int x, y;
  30. int w, h;
  31. int size;
  32. char *command;
  33. char *output_err;
  34. char *output_res;
  35. };
  36. struct input_box *widget_ibox_init(caca_canvas_t * cv, int w, int h);
  37. int widget_ibox_draw(struct input_box *box);
  38. int widget_ibox_handle_key(struct input_box *box, unsigned int c);
  39. char* widget_ibox_get_text(struct input_box *box);
  40. void widget_ibox_destroy(struct input_box *box);
  41. void widget_ibox_set_error(struct input_box *box, char *err);
  42. void widget_ibox_set_msg(struct input_box *box, char *msg);