FunctionBar.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef HEADER_FunctionBar
  2. #define HEADER_FunctionBar
  3. /*
  4. htop - FunctionBar.h
  5. (C) 2004-2011 Hisham H. Muhammad
  6. Released under the GNU GPLv2+, see the COPYING file
  7. in the source distribution for its full text.
  8. */
  9. #include <stdbool.h>
  10. typedef struct FunctionBar_ {
  11. int size;
  12. char** functions;
  13. union {
  14. char** keys;
  15. const char* const* constKeys;
  16. } keys;
  17. int* events;
  18. bool staticData;
  19. } FunctionBar;
  20. #define FUNCTIONBAR_MAXEVENTS 15
  21. FunctionBar* FunctionBar_newEnterEsc(const char* enter, const char* esc);
  22. FunctionBar* FunctionBar_new(const char* const* functions, const char* const* keys, const int* events);
  23. void FunctionBar_delete(FunctionBar* this);
  24. void FunctionBar_setLabel(FunctionBar* this, int event, const char* text);
  25. int FunctionBar_draw(const FunctionBar* this);
  26. int FunctionBar_drawExtra(const FunctionBar* this, const char* buffer, int attr, bool setCursor);
  27. void FunctionBar_append(const char* buffer, int attr);
  28. int FunctionBar_synthesizeEvent(const FunctionBar* this, int pos);
  29. #endif