mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-15 21:44:36 +03:00
Changes in object model: separate class objects to store vtable. Also, nicer UTF-8 display of big numbers.
This commit is contained in:
@ -29,22 +29,18 @@ typedef struct FunctionBar_ {
|
||||
|
||||
}*/
|
||||
|
||||
#ifdef DEBUG
|
||||
char* FUNCTIONBAR_CLASS = "FunctionBar";
|
||||
#else
|
||||
#define FUNCTIONBAR_CLASS NULL
|
||||
#endif
|
||||
|
||||
static const char* FunctionBar_FKeys[] = {"F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", NULL};
|
||||
|
||||
static const char* FunctionBar_FLabels[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", NULL};
|
||||
|
||||
static int FunctionBar_FEvents[] = {KEY_F(1), KEY_F(2), KEY_F(3), KEY_F(4), KEY_F(5), KEY_F(6), KEY_F(7), KEY_F(8), KEY_F(9), KEY_F(10)};
|
||||
|
||||
ObjectClass FunctionBar_class = {
|
||||
.delete = FunctionBar_delete
|
||||
};
|
||||
|
||||
FunctionBar* FunctionBar_new(const char** functions, const char** keys, int* events) {
|
||||
FunctionBar* this = malloc(sizeof(FunctionBar));
|
||||
Object_setClass(this, FUNCTIONBAR_CLASS);
|
||||
((Object*) this)->delete = FunctionBar_delete;
|
||||
FunctionBar* this = AllocThis(FunctionBar);
|
||||
this->functions = (char**) functions;
|
||||
if (keys && events) {
|
||||
this->staticData = false;
|
||||
|
Reference in New Issue
Block a user