Panel* Panel_new(int x, int y, int w, int h, bool owner, ObjectClass* type, FunctionBar* fuBar) { Panel* this; this = xMalloc(sizeof(Panel)); Object_setClass(this, Class(Panel)); Panel_init(this, x, y, w, h, type, owner, fuBar); return this; }
void UnsupportedProcess_delete(Object* cast) { Process* this = (Process*) cast; Object_setClass(this, Class(Process)); Process_done((Process*)cast); // free platform-specific fields here free(this); }
DarwinProcess* DarwinProcess_new(Settings* settings) { DarwinProcess* this = calloc(1, sizeof(DarwinProcess)); Object_setClass(this, Class(DarwinProcess)); Process_init(&this->super, settings); this->utime = 0; this->stime = 0; return this; }
TraceScreen* TraceScreen_new(Process* process) { TraceScreen* this = xMalloc(sizeof(TraceScreen)); Object_setClass(this, Class(TraceScreen)); this->tracing = true; this->contLine = false; this->follow = false; FunctionBar* fuBar = FunctionBar_new(TraceScreenFunctions, TraceScreenKeys, TraceScreenEvents); CRT_disableDelay(); return (TraceScreen*) InfoScreen_init(&this->super, process, fuBar, LINES-2, ""); }
Meter* Meter_new(struct ProcessList_* pl, int param, MeterClass* type) { Meter* this = xCalloc(1, sizeof(Meter)); Object_setClass(this, type); this->h = 1; this->param = param; this->pl = pl; type->curItems = type->maxItems; this->values = xCalloc(type->maxItems, sizeof(double)); this->total = type->total; this->caption = xStrdup(type->caption); if (Meter_initFn(this)) Meter_init(this); Meter_setMode(this, type->defaultMode); return this; }
FreeBSDProcess* FreeBSDProcess_new(Settings* settings) { FreeBSDProcess* this = calloc(1, sizeof(FreeBSDProcess)); Object_setClass(this, Class(FreeBSDProcess)); Process_init(&this->super, settings); return this; }
Process* UnsupportedProcess_new(Settings* settings) { Process* this = calloc(sizeof(Process), 1); Object_setClass(this, Class(Process)); Process_init(this, settings); return this; }
LinuxProcess* LinuxProcess_new(Settings* settings) { LinuxProcess* this = calloc(1, sizeof(LinuxProcess)); Object_setClass(this, Class(LinuxProcess)); Process_init(&this->super, settings); return this; }
EnvScreen* EnvScreen_new(Process* process) { EnvScreen* this = xMalloc(sizeof(EnvScreen)); Object_setClass(this, Class(EnvScreen)); return (EnvScreen*) InfoScreen_init(&this->super, process, NULL, LINES-3, " "); }