Adedeji Adebisi | 684ec91 | 2021-07-22 18:07:52 +0000 | [diff] [blame] | 1 | // Copyright 2021 Google LLC |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | #pragma once |
| 16 | |
| 17 | #include "bargraph.hpp" |
| 18 | |
| 19 | #include <ncurses.h> |
| 20 | |
| 21 | #include <string> |
| 22 | |
| 23 | const int INVALID = -999; // Constant indicating invalid indices |
| 24 | struct Rect |
| 25 | { |
| 26 | int x, y, w, h; // X, Y, Width, Height |
Patrick Williams | f5c0b9d | 2023-03-14 09:31:01 -0500 | [diff] [blame] | 27 | Rect(int _x, int _y, int _w, int _h) : x(_x), y(_y), w(_w), h(_h) {} |
| 28 | Rect() : x(0), y(0), w(1), h(1) {} |
Adedeji Adebisi | 684ec91 | 2021-07-22 18:07:52 +0000 | [diff] [blame] | 29 | }; |
| 30 | |
| 31 | int DrawTextWithWidthLimit(WINDOW* win, std::string txt, int y, int x, |
| 32 | int width, const std::string& delimiters); |
| 33 | std::string FloatToString(float value); |
| 34 | template <typename T> |
| 35 | void HistoryBarGraph(WINDOW* win, const Rect& rect, BarGraph<T>* bargraph); |
Sui Chen | 8c5208f | 2023-04-21 14:10:05 -0700 | [diff] [blame] | 36 | void DBusTopUpdateFooterView(); |