aboutsummaryrefslogtreecommitdiffstats
path: root/unsupported/UnsupportedProcess.c
diff options
context:
space:
mode:
Diffstat (limited to 'unsupported/UnsupportedProcess.c')
-rw-r--r--unsupported/UnsupportedProcess.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/unsupported/UnsupportedProcess.c b/unsupported/UnsupportedProcess.c
index 2aca048..3d6d883 100644
--- a/unsupported/UnsupportedProcess.c
+++ b/unsupported/UnsupportedProcess.c
@@ -44,10 +44,10 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
[TGID] = { .name = "TGID", .title = "TGID", .description = "Thread group ID (i.e. process ID)", .flags = 0, .pidColumn = true, },
};
-Process* UnsupportedProcess_new(const Settings* settings) {
+Process* UnsupportedProcess_new(const Machine* host) {
Process* this = xCalloc(1, sizeof(UnsupportedProcess));
Object_setClass(this, Class(UnsupportedProcess));
- Process_init(this, settings);
+ Process_init(this, host);
return this;
}
@@ -58,23 +58,24 @@ void Process_delete(Object* cast) {
free(cast);
}
-static void UnsupportedProcess_writeField(const Process* this, RichString* str, ProcessField field) {
- const UnsupportedProcess* up = (const UnsupportedProcess*) this;
- bool coloring = this->settings->highlightMegabytes;
+static void UnsupportedProcess_rowWriteField(const Row* super, RichString* str, ProcessField field) {
+ const UnsupportedProcess* up = (const UnsupportedProcess*) super;
+
+ bool coloring = super->host->settings->highlightMegabytes;
char buffer[256]; buffer[255] = '\0';
int attr = CRT_colors[DEFAULT_COLOR];
size_t n = sizeof(buffer) - 1;
- (void) up;
(void) coloring;
(void) n;
switch (field) {
/* Add platform specific fields */
default:
- Process_writeField(this, str, field);
+ Process_writeField(&up->super, str, field);
return;
}
+
RichString_appendWide(str, attr, buffer);
}
@@ -94,11 +95,18 @@ static int UnsupportedProcess_compareByKey(const Process* v1, const Process* v2,
const ProcessClass UnsupportedProcess_class = {
.super = {
- .extends = Class(Process),
- .display = Process_display,
- .delete = Process_delete,
- .compare = Process_compare
+ .super = {
+ .extends = Class(Process),
+ .display = Row_display,
+ .delete = Process_delete,
+ .compare = Process_compare
+ },
+ .isHighlighted = Process_rowIsHighlighted,
+ .isVisible = Process_rowIsVisible,
+ .matchesFilter = Process_rowMatchesFilter,
+ .compareByParent = Process_compareByParent,
+ .sortKeyString = Process_rowGetSortKey,
+ .writeField = UnsupportedProcess_rowWriteField
},
- .writeField = UnsupportedProcess_writeField,
.compareByKey = UnsupportedProcess_compareByKey
};

© 2014-2024 Faster IT GmbH | imprint | privacy policy