PCPDynamicScreen.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef HEADER_PCPDynamicScreen
  2. #define HEADER_PCPDynamicScreen
  3. /*
  4. htop - PCPDynamicScreen.h
  5. (C) 2023 htop dev team
  6. Released under the GNU GPLv2+, see the COPYING file
  7. in the source distribution for its full text.
  8. */
  9. #include <stddef.h>
  10. #include <stdbool.h>
  11. #include "CRT.h"
  12. #include "DynamicScreen.h"
  13. #include "Hashtable.h"
  14. #include "Machine.h"
  15. #include "Panel.h"
  16. #include "Settings.h"
  17. struct InDomTable_;
  18. struct PCPDynamicColumn_;
  19. struct PCPDynamicColumns_;
  20. typedef struct PCPDynamicScreen_ {
  21. DynamicScreen super;
  22. struct InDomTable_* table;
  23. struct PCPDynamicColumn_** columns;
  24. size_t totalColumns;
  25. unsigned int indom; /* instance domain number */
  26. unsigned int key; /* PCPMetric identifier */
  27. bool defaultEnabled; /* enabled setting from configuration file */
  28. /* at runtime enabled screens have entries in settings->screens */
  29. } PCPDynamicScreen;
  30. typedef struct PCPDynamicScreens_ {
  31. Hashtable* table;
  32. size_t count; /* count of dynamic screens discovered from scan */
  33. } PCPDynamicScreens;
  34. void PCPDynamicScreens_init(PCPDynamicScreens* screens, struct PCPDynamicColumns_* columns);
  35. void PCPDynamicScreens_done(Hashtable* table);
  36. void PCPDynamicScreen_appendTables(PCPDynamicScreens* screens, Machine* host);
  37. void PCPDynamicScreen_appendScreens(PCPDynamicScreens* screens, Settings* settings);
  38. void PCPDynamicScreen_addDynamicScreen(PCPDynamicScreens* screens, ScreenSettings* ss);
  39. void PCPDynamicScreens_addAvailableColumns(Panel* availableColumns, Hashtable* screens, const char* screen);
  40. #endif